forked from bartvdbraak/blender
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.
This commit is contained in:
parent
95002a98bf
commit
0060b9a8ef
@ -757,8 +757,8 @@ void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, short only3d)
|
|||||||
{
|
{
|
||||||
bGPdata *gpd;
|
bGPdata *gpd;
|
||||||
int dflag = 0;
|
int dflag = 0;
|
||||||
rcti rect;
|
|
||||||
RegionView3D *rv3d = ar->regiondata;
|
RegionView3D *rv3d = ar->regiondata;
|
||||||
|
int offsx, offsy, winx, winy;
|
||||||
|
|
||||||
/* check that we have grease-pencil stuff to draw */
|
/* check that we have grease-pencil stuff to draw */
|
||||||
gpd = gpencil_data_get_active_v3d(scene); // XXX
|
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)) {
|
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
|
||||||
rctf rectf;
|
rctf rectf;
|
||||||
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, TRUE); /* no shift */
|
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 {
|
else {
|
||||||
rect.xmin = 0;
|
offsx = 0;
|
||||||
rect.ymin = 0;
|
offsy = 0;
|
||||||
rect.xmax = ar->winx;
|
winx = ar->winx;
|
||||||
rect.ymax = ar->winy;
|
winy = ar->winy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw it! */
|
/* draw it! */
|
||||||
if (only3d) dflag |= (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_NOSTATUS);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************** */
|
/* ************************************************** */
|
||||||
|
Loading…
Reference in New Issue
Block a user