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:
Diffstat (limited to 'source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
index 59a1e08d95a..1185bec2a2d 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/arrow2d_manipulator.c
@@ -66,18 +66,12 @@ static void arrow2d_draw_geom(wmManipulator *mpr, const float matrix[4][4], cons
const float size_h = size / 2.0f;
const float arrow_length = RNA_float_get(mpr->ptr, "length");
const float arrow_angle = RNA_float_get(mpr->ptr, "angle");
- const float draw_line_ofs = (mpr->line_width * 0.5f) / mpr->scale_final;
uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
gpuPushMatrix();
gpuMultMatrix(matrix);
- gpuScaleUniform(mpr->scale_final);
gpuRotate2D(RAD2DEGF(arrow_angle));
- /* local offset */
- gpuTranslate2f(
- mpr->matrix_offset[3][0] + draw_line_ofs,
- mpr->matrix_offset[3][1]);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -101,20 +95,25 @@ static void arrow2d_draw_geom(wmManipulator *mpr, const float matrix[4][4], cons
static void manipulator_arrow2d_draw(const bContext *UNUSED(C), wmManipulator *mpr)
{
- float col[4];
+ float color[4];
- manipulator_color_get(mpr, mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT, col);
+ float matrix_final[4][4];
+
+ manipulator_color_get(mpr, mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT, color);
glLineWidth(mpr->line_width);
+
+ WM_manipulator_calc_matrix_final(mpr, matrix_final);
+
glEnable(GL_BLEND);
- arrow2d_draw_geom(mpr, mpr->matrix_basis, col);
+ arrow2d_draw_geom(mpr, matrix_final, color);
glDisable(GL_BLEND);
if (mpr->interaction_data) {
ManipulatorInteraction *inter = mpr->interaction_data;
glEnable(GL_BLEND);
- arrow2d_draw_geom(mpr, inter->init_matrix, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f});
+ arrow2d_draw_geom(mpr, inter->init_matrix_final, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f});
glDisable(GL_BLEND);
}
}
@@ -129,7 +128,9 @@ static void manipulator_arrow2d_invoke(
{
ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
- copy_m4_m4(inter->init_matrix, mpr->matrix_basis);
+ copy_m4_m4(inter->init_matrix_basis, mpr->matrix_basis);
+ WM_manipulator_calc_matrix_final(mpr, inter->init_matrix_final);
+
mpr->interaction_data = inter;
}