diff options
author | Habib Gahbiche <zazizizou> | 2022-03-17 01:27:52 +0300 |
---|---|---|
committer | Habib Gahbiche <habibgahbiche@gmail.com> | 2022-03-17 01:28:36 +0300 |
commit | 33409f9f1cd42e899f2706fe7878e5e89b50d617 (patch) | |
tree | 1b33eac06e04867add023aa5e88c8cf577e5dc01 /source/blender/editors/space_node/drawnode.cc | |
parent | 22de21bef1a31718d45e89aedc574055a5983b7d (diff) |
Compositor: Support backdrop offset for the Viewer node
This is only part of the experimental "Full Frame" mode (disabled
by default). See T88150.
Currently the viewer node uses buffer paddings to display image offset
in the backdrop as a temporal solution implemented for {D12466}.
This solution is inefficient memory and performance-wise. Another
issue is that the paddings are part the image when saved.
This patch instead sets the offset in the Viewer node image
as variables and makes the backdrop take it into account
when drawing the image or any related gizmo.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D12750
Diffstat (limited to 'source/blender/editors/space_node/drawnode.cc')
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 365a17c0a04..ad647cf019d 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -1499,8 +1499,10 @@ void draw_nodespace_back_pix(const bContext &C, if (ibuf) { /* somehow the offset has to be calculated inverse */ wmOrtho2_region_pixelspace(®ion); - const float x = (region.winx - snode.zoom * ibuf->x) / 2 + snode.xof; - const float y = (region.winy - snode.zoom * ibuf->y) / 2 + snode.yof; + const float offset_x = snode.xof + ima->display_offset_x; + const float offset_y = snode.yof + ima->display_offset_y; + const float x = (region.winx - snode.zoom * ibuf->x) / 2 + offset_x; + const float y = (region.winy - snode.zoom * ibuf->y) / 2 + offset_y; /** \note draw selected info on backdrop */ if (snode.edittree) { |