[Bf-blender-cvs] [d8c08f36333] temp-gpu-image-engine: Fixed backdrop slipping.

Jeroen Bakker noreply at git.blender.org
Tue Dec 14 15:32:02 CET 2021


Commit: d8c08f36333aa49da42ecdc3f6e4ec567e072539
Author: Jeroen Bakker
Date:   Tue Dec 14 15:31:36 2021 +0100
Branches: temp-gpu-image-engine
https://developer.blender.org/rBd8c08f36333aa49da42ecdc3f6e4ec567e072539

Fixed backdrop slipping.

===================================================================

M	source/blender/draw/engines/image/image_space_node.hh

===================================================================

diff --git a/source/blender/draw/engines/image/image_space_node.hh b/source/blender/draw/engines/image/image_space_node.hh
index d9335e3dd13..4e76cbdc6da 100644
--- a/source/blender/draw/engines/image/image_space_node.hh
+++ b/source/blender/draw/engines/image/image_space_node.hh
@@ -124,8 +124,10 @@ class SpaceNodeAccessor : public AbstractSpaceAccessor {
     mul_v2_v2fl(display_resolution, image_resolution, snode->zoom);
     const float scale_x = display_resolution[0] / region->winx;
     const float scale_y = display_resolution[1] / region->winy;
-    const float translate_x = 0.5f - 0.5f * scale_x + snode->xof / image_resolution[0];
-    const float translate_y = 0.5 - 0.5f * scale_y + snode->yof / image_resolution[1];
+    const float translate_x = (region->winx * 0.5f - display_resolution[0] * 0.5f + snode->xof) /
+                              region->winx;
+    const float translate_y = (region->winy * 0.5f - display_resolution[1] * 0.5f + snode->yof) /
+                              region->winy;
 
     r_uv_to_texture[0][0] = scale_x;
     r_uv_to_texture[1][1] = scale_y;



More information about the Bf-blender-cvs mailing list