[Bf-blender-cvs] [a761a93d411] master: Fix VSE color picker

Richard Antalik noreply at git.blender.org
Mon Mar 18 21:11:57 CET 2019


Commit: a761a93d411da3798ff52f8c48381c5f46690818
Author: Richard Antalik
Date:   Mon Mar 18 12:04:11 2019 -0700
Branches: master
https://developer.blender.org/rBa761a93d411da3798ff52f8c48381c5f46690818

Fix VSE color picker

Fix VSE color picker mouse coords calculation

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4396

===================================================================

M	source/blender/editors/space_sequencer/sequencer_view.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c
index d500a9a081d..d0e31dbbe79 100644
--- a/source/blender/editors/space_sequencer/sequencer_view.c
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -100,8 +100,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
 
 	UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy);
 
-	fx += (float) ibuf->x / 2.0f;
-	fy += (float) ibuf->y / 2.0f;
+	fx += (float)scene->r.xsch / 2.0f;
+	fy += (float)scene->r.ysch / 2.0f;
+	fx *= (float)ibuf->x / (float)scene->r.xsch;
+	fy *= (float)ibuf->y / (float)scene->r.ysch;
 
 	if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->x && fy < ibuf->y) {
 		const float *fp;



More information about the Bf-blender-cvs mailing list