diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-07-20 17:53:01 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-07-20 17:53:01 +0300 |
commit | 55b0f37d4b9dba06a41eaeb3204475452474a902 (patch) | |
tree | 2be786fcd625cd10ea6ac83db08417ee8f9cccbd | |
parent | a078e9f74f55b3d3e5fcf38e0ec9742be7895554 (diff) |
GPencil: Fix error for Pivot when object not in origin
-rw-r--r-- | source/blender/editors/gpencil/gpencil_asset.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_asset.c b/source/blender/editors/gpencil/gpencil_asset.c index de9b28ba743..a7baccab2c9 100644 --- a/source/blender/editors/gpencil/gpencil_asset.c +++ b/source/blender/editors/gpencil/gpencil_asset.c @@ -745,15 +745,19 @@ static void gpencil_asset_transform_strokes(tGPDasset *tgpa, if (!shift_key) { if (tgpa->manipulator_index == CAGE_CORNER_N) { gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_S], pivot); + sub_v3_v3v3(pivot, pivot, tgpa->ob->loc); } else if (tgpa->manipulator_index == CAGE_CORNER_E) { gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_W], pivot); + sub_v3_v3v3(pivot, pivot, tgpa->ob->loc); } else if (tgpa->manipulator_index == CAGE_CORNER_S) { gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_N], pivot); + sub_v3_v3v3(pivot, pivot, tgpa->ob->loc); } else if (tgpa->manipulator_index == CAGE_CORNER_W) { gpencil_point_xy_to_3d(&tgpa->gsc, tgpa->scene, tgpa->manipulator[CAGE_CORNER_E], pivot); + sub_v3_v3v3(pivot, pivot, tgpa->ob->loc); } } @@ -1005,11 +1009,6 @@ static void gpencil_draw_cage(tGPDasset *tgpa) tgpa->manipulator[CAGE_CORNER_ROT_NW + i][1] + gap); } - // immBegin(GPU_PRIM_LINES, 2); - // immVertex2f(pos, tgpa->manipulator[CAGE_CORNER_NE][0], tgpa->manipulator[CAGE_CORNER_NE][1]); - // immVertex2f(pos, tgpa->manipulator[CAGE_CORNER_ROT][0], - // tgpa->manipulator[CAGE_CORNER_ROT][1]); immEnd(); - /* Draw a line while is doing a transform. */ if ((tgpa->flag & GP_ASSET_FLAG_TRANSFORMING) && (tgpa->mode == GP_ASSET_TRANSFORM_ROT)) { const float line_color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; |