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-12-13 10:36:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-13 10:36:02 +0400
commit3a408317192a7662dd5568e6b295174b025cefb4 (patch)
tree1e2699be30b83f360d92ea6f831ce58f65f5305b /source/blender/editors
parente036c90253cc0afafef6bf8a2e85158d934ba5c8 (diff)
image view cursor wasn't scaling up with the DPI
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index c4267358d61..c6b251b04ae 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -60,48 +60,49 @@
#include "ED_uvedit.h"
#include "UI_resources.h"
+#include "UI_interface.h"
#include "uvedit_intern.h"
void draw_image_cursor(SpaceImage *sima, ARegion *ar)
{
- float zoomx, zoomy, w, h;
+ float zoomx, zoomy, x_fac, y_fac;
int width, height;
ED_space_image_get_size(sima, &width, &height);
ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
- w = zoomx * width / 256.0f;
- h = zoomy * height / 256.0f;
+ x_fac = (1.0f / (zoomx * width / 256.0f)) * UI_DPI_FAC;
+ y_fac = (1.0f / (zoomy * height / 256.0f)) * UI_DPI_FAC;
cpack(0xFFFFFF);
glTranslatef(sima->cursor[0], sima->cursor[1], 0.0);
- fdrawline(-0.05f / w, 0, 0, 0.05f / h);
- fdrawline(0, 0.05f / h, 0.05f / w, 0.0f);
- fdrawline(0.05f / w, 0.0f, 0.0f, -0.05f / h);
- fdrawline(0.0f, -0.05f / h, -0.05f / w, 0.0f);
+ fdrawline(-0.05f * x_fac, 0, 0, 0.05f * y_fac);
+ fdrawline(0, 0.05f * y_fac, 0.05f * x_fac, 0.0f);
+ fdrawline(0.05f * x_fac, 0.0f, 0.0f, -0.05f * y_fac);
+ fdrawline(0.0f, -0.05f * y_fac, -0.05f * x_fac, 0.0f);
setlinestyle(4);
cpack(0xFF);
- fdrawline(-0.05f / w, 0.0f, 0.0f, 0.05f / h);
- fdrawline(0.0f, 0.05f / h, 0.05f / w, 0.0f);
- fdrawline(0.05f / w, 0.0f, 0.0f, -0.05f / h);
- fdrawline(0.0f, -0.05f / h, -0.05f / w, 0.0f);
+ fdrawline(-0.05f * x_fac, 0.0f, 0.0f, 0.05f * y_fac);
+ fdrawline(0.0f, 0.05f * y_fac, 0.05f * x_fac, 0.0f);
+ fdrawline(0.05f * x_fac, 0.0f, 0.0f, -0.05f * y_fac);
+ fdrawline(0.0f, -0.05f * y_fac, -0.05f * x_fac, 0.0f);
setlinestyle(0.0f);
cpack(0x0);
- fdrawline(-0.020f / w, 0.0f, -0.1f / w, 0.0f);
- fdrawline(0.1f / w, 0.0f, 0.020f / w, 0.0f);
- fdrawline(0.0f, -0.020f / h, 0.0f, -0.1f / h);
- fdrawline(0.0f, 0.1f / h, 0.0f, 0.020f / h);
+ fdrawline(-0.020f * x_fac, 0.0f, -0.1f * x_fac, 0.0f);
+ fdrawline(0.1f * x_fac, 0.0f, 0.020f * x_fac, 0.0f);
+ fdrawline(0.0f, -0.020f * y_fac, 0.0f, -0.1f * y_fac);
+ fdrawline(0.0f, 0.1f * y_fac, 0.0f, 0.020f * y_fac);
setlinestyle(1);
cpack(0xFFFFFF);
- fdrawline(-0.020f / w, 0.0f, -0.1f / w, 0.0f);
- fdrawline(0.1f / w, 0.0f, 0.020f / w, 0.0f);
- fdrawline(0.0f, -0.020f / h, 0.0f, -0.1f / h);
- fdrawline(0.0f, 0.1f / h, 0.0f, 0.020f / h);
+ fdrawline(-0.020f * x_fac, 0.0f, -0.1f * x_fac, 0.0f);
+ fdrawline(0.1f * x_fac, 0.0f, 0.020f * x_fac, 0.0f);
+ fdrawline(0.0f, -0.020f * y_fac, 0.0f, -0.1f * y_fac);
+ fdrawline(0.0f, 0.1f * y_fac, 0.0f, 0.020f * y_fac);
glTranslatef(-sima->cursor[0], -sima->cursor[1], 0.0);
setlinestyle(0);