mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-01 10:13:22 +00:00
Fix wrong alignment between mouse and sensor threshold position (fix #4428)
This commit is contained in:
parent
92edd5f700
commit
805a8259a1
@ -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.
|
||||
@ -166,7 +166,9 @@ private:
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user