diff options
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 36a2b4c2893..e3070903ccc 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -3212,15 +3212,15 @@ void ED_region_image_metadata_panel_draw(ImBuf *ibuf, uiLayout *layout) IMB_metadata_foreach(ibuf, metadata_panel_draw_field, &ctx); } -void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy) +void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy, float x0, float y0) { float gridsize, gridstep = 1.0f / 32.0f; float fac, blendfac; int x1, y1, x2, y2; - /* the image is located inside (0, 0), (1, 1) as set by view2d */ - UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x1, &y1); - UI_view2d_view_to_region(&ar->v2d, 1.0f, 1.0f, &x2, &y2); + /* the image is located inside (x0, y0), (x0+1, y0+1) as set by view2d */ + UI_view2d_view_to_region(&ar->v2d, x0, y0, &x1, &y1); + UI_view2d_view_to_region(&ar->v2d, x0 + 1.0f, y0 + 1.0f, &x2, &y2); GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); |