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 1a63bc1cd53..ff12ed90621 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2735,15 +2735,15 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, GPU_matrix_pop(); } -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); |