Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-26 11:37:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-26 11:37:12 +0400
commit0060b9a8ef9cdb3be0f89b872b736725c822b2c2 (patch)
tree5d0556ab36f74207866c2276b0239ad20088594f /source/blender/editors/gpencil
parent95002a98bfab3ccad94134fc8bbedab19cd0289f (diff)
fix [#32661] Grease Pencil in Camera View
Regression since 2.63a release. own fault in r49996, though code was confusing - using rcti struct for offset+width.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 5a94d54f329..5ff4ccbd126 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -757,8 +757,8 @@ void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, short only3d)
{
bGPdata *gpd;
int dflag = 0;
- rcti rect;
RegionView3D *rv3d = ar->regiondata;
+ int offsx, offsy, winx, winy;
/* check that we have grease-pencil stuff to draw */
gpd = gpencil_data_get_active_v3d(scene); // XXX
@@ -769,19 +769,23 @@ void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, short only3d)
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, TRUE); /* no shift */
- BLI_rcti_rctf_copy(&rect, &rectf);
+
+ offsx = floorf(rectf.xmin + 0.5f);
+ offsy = floorf(rectf.ymin + 0.5f);
+ winx = floorf((rectf.xmax - rectf.xmin) + 0.5f);
+ winy = floorf((rectf.ymax - rectf.ymin) + 0.5f);
}
else {
- rect.xmin = 0;
- rect.ymin = 0;
- rect.xmax = ar->winx;
- rect.ymax = ar->winy;
+ offsx = 0;
+ offsy = 0;
+ winx = ar->winx;
+ winy = ar->winy;
}
/* draw it! */
if (only3d) dflag |= (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_NOSTATUS);
- gp_draw_data(gpd, rect.xmin, rect.ymin, rect.xmax, rect.ymax, CFRA, dflag);
+ gp_draw_data(gpd, offsx, offsy, winx, winy, CFRA, dflag);
}
/* ************************************************** */