Skip to content

Commit

Permalink
file explorer scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Dec 29, 2021
1 parent 71a8db2 commit aabd6bc
Show file tree
Hide file tree
Showing 8 changed files with 256 additions and 766 deletions.
25 changes: 8 additions & 17 deletions core/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,23 +1153,14 @@ impl LapceEditorBufferData {
);

let mut path = self.buffer.path.clone();
let svg = file_svg_new(
&path
.extension()
.and_then(|s| s.to_str())
.unwrap_or("")
.to_string(),
);

if let Some(svg) = svg.as_ref() {
let width = 13.0;
let height = 13.0;
let rect = Size::new(width, height).to_rect().with_origin(Point::new(
(30.0 - width) / 2.0,
(30.0 - height) / 2.0,
));
ctx.draw_svg(&svg, rect, None);
}
let svg = file_svg_new(&path);

let width = 13.0;
let height = 13.0;
let rect = Size::new(width, height)
.to_rect()
.with_origin(Point::new((30.0 - width) / 2.0, (30.0 - height) / 2.0));
ctx.draw_svg(&svg, rect, None);

let mut file_name = path
.file_name()
Expand Down
Loading

0 comments on commit aabd6bc

Please sign in to comment.