From 0480cf1a608db6a387ff70342dd5189500fd4ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 29 May 2006 19:00:20 +0000 Subject: [PATCH] * The (right-most moved) tab no longer goes away when resizing the window to a size smaller than the tab size. This fixes bug #642. * There are remaining issues while resizing the window, though. * Fixed warning. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17637 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/DefaultDecorator.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/servers/app/DefaultDecorator.cpp b/src/servers/app/DefaultDecorator.cpp index 42904aecc5..c4eb4bc6a9 100644 --- a/src/servers/app/DefaultDecorator.cpp +++ b/src/servers/app/DefaultDecorator.cpp @@ -19,11 +19,11 @@ #include "PatternHandler.h" #include "RGBColor.h" +#include + #include #include -#include - #include //#define DEBUG_DECORATOR @@ -319,6 +319,8 @@ DefaultDecorator::ResizeBy(BPoint pt, BRegion* dirty) tabSize = fBottomBorder.bottom - fTopBorder.top; maxLocation = tabSize - _tabrect.Height(); } + if (maxLocation < 0) + maxLocation = 0; float tabOffset = floorf(fTabLocation * maxLocation); float delta = tabOffset - fTabOffset; @@ -698,7 +700,7 @@ DefaultDecorator::_DoLayout() if (fTabOffset < 0) fTabOffset = 0; if (fTabOffset > (fRightBorder.right - fLeftBorder.left - _tabrect.Width())) - fTabOffset = (fRightBorder.right - fLeftBorder.left - _tabrect.Width()); + fTabOffset = uint32(fRightBorder.right - fLeftBorder.left - _tabrect.Width()); _tabrect.OffsetBy(fTabOffset, 0); // finally, layout the buttons and text within the tab rect @@ -710,8 +712,8 @@ DefaultDecorator::_DoLayout() void DefaultDecorator::_DrawFrame(BRect invalid) { -STRACE(("_DrawFrame(%f,%f,%f,%f)\n", invalid.left, invalid.top, - invalid.right, invalid.bottom)); + STRACE(("_DrawFrame(%f,%f,%f,%f)\n", invalid.left, invalid.top, + invalid.right, invalid.bottom)); // NOTE: the DrawingEngine needs to be locked for the entire // time for the clipping to stay valid for this decorator