From 0af9da22144d85dc543aa01cf6e18f3a34d49ac9 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 23 Dec 2023 22:37:59 +0100 Subject: [PATCH] BugFix Mask Paint Cropped source --- src/TextureView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TextureView.cpp b/src/TextureView.cpp index a9139b3..ff5163a 100644 --- a/src/TextureView.cpp +++ b/src/TextureView.cpp @@ -1084,8 +1084,10 @@ View::Cursor TextureView::grab (Source *s, glm::vec2 from, glm::vec2 to, std::pa if (grid->active()) scene_brush_pos = grid->snap(scene_brush_pos); // inform shader of a cursor action : coordinates and crop scaling - edit_source_->maskShader()->cursor = glm::vec4(scene_brush_pos.x, scene_brush_pos.y, - edit_source_->mixingsurface_->scale_.x, edit_source_->mixingsurface_->scale_.y); + edit_source_->maskShader()->cursor = glm::vec4(scene_brush_pos.x - shift_crop_.x, + scene_brush_pos.y - shift_crop_.y, + edit_source_->mixingsurface_->scale_.x, + edit_source_->mixingsurface_->scale_.y); edit_source_->touch(Source::SourceUpdate_Mask); // action label info << MASK_PAINT_ACTION_LABEL;