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:
-rw-r--r--source/blender/editors/interface/view2d.c19
-rw-r--r--source/blender/editors/space_outliner/outliner.c2
2 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index ae414c6e557..a2a16afc2f8 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -255,8 +255,6 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* absolutely no scrollers allowed */
v2d->scroll= 0;
- /* pixel offsets need to be applied for smooth UI controls */
- v2d->flag |= (V2D_PIXELOFS_X|V2D_PIXELOFS_Y);
}
break;
@@ -980,10 +978,6 @@ void UI_view2d_view_ortho(View2D *v2d)
/* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing,
* but only applied where requsted
*/
- /* XXX ton: fix this! */
- xofs= 0.0; // (v2d->flag & V2D_PIXELOFS_X) ? 0.375f : 0.0f;
- yofs= 0.0; // (v2d->flag & V2D_PIXELOFS_Y) ? 0.375f : 0.0f;
-
/* XXX brecht: instead of zero at least use a tiny offset, otherwise
* pixel rounding is effectively random due to float inaccuracy */
xofs= 0.001f*(v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
@@ -992,6 +986,19 @@ void UI_view2d_view_ortho(View2D *v2d)
/* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */
view2d_map_cur_using_mask(v2d, &curmasked);
+ curmasked.xmin-= xofs; curmasked.xmax-=xofs;
+ curmasked.ymin-= yofs; curmasked.ymax-=yofs;
+
+ /* XXX ton: this flag set by outliner, for icons */
+ if(v2d->flag & V2D_PIXELOFS_X) {
+ curmasked.xmin= floor(curmasked.xmin) + 0.375f;
+ curmasked.xmax= floor(curmasked.xmax) + 0.375f;
+ }
+ if(v2d->flag & V2D_PIXELOFS_Y) {
+ curmasked.ymin= floor(curmasked.ymin) + 0.375f;
+ curmasked.ymax= floor(curmasked.ymax) + 0.375f;
+ }
+
/* set matrix on all appropriate axes */
wmOrtho2(curmasked.xmin-xofs, curmasked.xmax-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs);
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index b16fae73980..466eaa4c6e9 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -5718,6 +5718,8 @@ void draw_outliner(const bContext *C)
/* update size of tot-rect (extents of data/viewable area) */
UI_view2d_totRect_set(v2d, sizex, sizey);
+ /* force display to pixel coords */
+ v2d->flag |= (V2D_PIXELOFS_X|V2D_PIXELOFS_Y);
/* set matrix for 2d-view controls */
UI_view2d_view_ortho(v2d);