From 8017a9513be58454b10c324bc729d53880e3f9b5 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 20 Dec 2010 18:29:32 +0000 Subject: [PATCH] Bugfix, own collection: File Window draw error: On start Blender in smaller sized window, a scalled down screen causes the File Window main area to draw too high, clipping off half of the top line. This case (scroll horizontal only) is not handled as view2d type. --- source/blender/editors/space_file/space_file.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index b46704c8a6b..12cca144d80 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -327,6 +327,13 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) v2d->scroll = V2D_SCROLL_BOTTOM; v2d->keepofs &= ~V2D_LOCKOFS_X; v2d->keepofs |= V2D_LOCKOFS_Y; + + /* XXX this happens on scaling down Screen (like from startup.blend) */ + /* view2d has no type specific for filewindow case, which doesnt scroll vertically */ + if(v2d->cur.ymax < 0) { + v2d->cur.ymin -= v2d->cur.ymax; + v2d->cur.ymax= 0; + } } /* v2d has initialized flag, so this call will only set the mask correct */ UI_view2d_region_reinit(v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);