Skip to content

Commit

Permalink
Fix wrong alignment between mouse and sensor threshold position (fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gasparoken authored and dacap committed May 6, 2024
1 parent 92edd5f commit 805a825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/ui/dynamics_popup.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2020-2023 Igara Studio S.A.
// Copyright (C) 2020-2024 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
Expand Down Expand Up @@ -166,7 +166,9 @@ class DynamicsPopup::ThresholdSlider : public Widget {
break;

auto mouseMsg = static_cast<MouseMessage*>(msg);
const gfx::Rect rc = bounds();
gfx::Rect rc = bounds();
rc.shrink(border());
rc.shrink(gfx::Border(3, 0, 3, 1) * guiscale());
float u = (mouseMsg->position().x - rc.x) / float(rc.w);
u = std::clamp(u, 0.0f, 1.0f);
switch (capture) {
Expand Down

0 comments on commit 805a825

Please sign in to comment.