Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.cc
| Show First 20 Lines • Show All 1,493 Lines • ▼ Show 20 Lines | void draw_nodespace_back_pix(const bContext &C, | ||||
| GPU_depth_test(GPU_DEPTH_NONE); | GPU_depth_test(GPU_DEPTH_NONE); | ||||
| void *lock; | void *lock; | ||||
| Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node"); | Image *ima = BKE_image_ensure_viewer(bmain, IMA_TYPE_COMPOSITE, "Viewer Node"); | ||||
| ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock); | ImBuf *ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock); | ||||
| if (ibuf) { | if (ibuf) { | ||||
| /* somehow the offset has to be calculated inverse */ | /* somehow the offset has to be calculated inverse */ | ||||
| wmOrtho2_region_pixelspace(®ion); | wmOrtho2_region_pixelspace(®ion); | ||||
| const float x = (region.winx - snode.zoom * ibuf->x) / 2 + snode.xof; | const float offset_x = snode.xof + ima->display_offset_x; | ||||
| const float y = (region.winy - snode.zoom * ibuf->y) / 2 + snode.yof; | 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 */ | /** \note draw selected info on backdrop */ | ||||
| if (snode.edittree) { | if (snode.edittree) { | ||||
| bNode *node = (bNode *)snode.edittree->nodes.first; | bNode *node = (bNode *)snode.edittree->nodes.first; | ||||
| rctf *viewer_border = &snode.nodetree->viewer_border; | rctf *viewer_border = &snode.nodetree->viewer_border; | ||||
| while (node) { | while (node) { | ||||
| if (node->flag & NODE_SELECT) { | if (node->flag & NODE_SELECT) { | ||||
| if (node->typeinfo->draw_backdrop) { | if (node->typeinfo->draw_backdrop) { | ||||
| ▲ Show 20 Lines • Show All 676 Lines • Show Last 20 Lines | |||||