mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Check the sampler marker at its painted pixel index
This commit is contained in:
1 parent
c35196905f
commit
9123df29fc
1 file changed
+2
-1
@@ -105,7 +105,8 @@ fn sampler_mark(shape: &Shape, at: Pos2) -> bool {
|
||||
}
|
||||
|
||||
fn shows_marker(h: &AppHarness) -> bool {
|
||||
let at = to_screen(h.state(), POINT);
|
||||
// The engine stores the pixel centre, but the shared ColorSamplers collection uses the pixel index to paint.
|
||||
let at = to_screen(h.state(), POINT.map(f64::floor));
|
||||
h.output().shapes.iter().any(|clipped| clipped.clip_rect.contains(at) && sampler_mark(&clipped.shape, at))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user