Skip to content

Commit

Permalink
rounded rect radius should apply scale
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Aug 28, 2023
1 parent 8887ea0 commit d03f10a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/window_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl WindowHandle {

pub(crate) fn mouse_wheel(&mut self, delta: MouseScrollDelta) {
let delta = match delta {
MouseScrollDelta::LineDelta(x, y) => Vec2::new(-x as f64, -y as f64),
MouseScrollDelta::LineDelta(x, y) => Vec2::new(-x as f64 * 60.0, -y as f64 * 60.0),
MouseScrollDelta::PixelDelta(delta) => {
let position: LogicalPosition<f64> = delta.to_logical(self.scale);
Vec2::new(-position.x, -position.y)
Expand Down
4 changes: 2 additions & 2 deletions vger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl Renderer for VgerRenderer {
} else if let Some(rect) = shape.as_rounded_rect() {
let min = rect.origin();
let max = min + rect.rect().size().to_vec2();
let radius = rect.radii().top_left as f32;
let radius = (rect.radii().top_left * self.scale) as f32;
self.vger.stroke_rect(
self.vger_point(min),
self.vger_point(max),
Expand Down Expand Up @@ -219,7 +219,7 @@ impl Renderer for VgerRenderer {
} else if let Some(rect) = path.as_rounded_rect() {
self.vger.fill_rect(
self.vger_rect(rect.rect()),
rect.radii().top_left as f32,
(rect.radii().top_left * self.scale) as f32,
paint,
blur_radius as f32,
);
Expand Down

0 comments on commit d03f10a

Please sign in to comment.