From 7042f1dd6e0e5b7dc1f67ae084086be0f5692f17 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 9 Dec 2005 11:15:05 +0000 Subject: [PATCH] Mouse won't crash anymore if it can't find its bitmaps. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15431 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/mouse/SettingsView.cpp | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/preferences/mouse/SettingsView.cpp b/src/preferences/mouse/SettingsView.cpp index a9da23403a..53c8db7343 100644 --- a/src/preferences/mouse/SettingsView.cpp +++ b/src/preferences/mouse/SettingsView.cpp @@ -186,16 +186,24 @@ SettingsView::Draw(BRect updateFrame) SetDrawingMode(B_OP_OVER); // Draw the icons - if (updateFrame.Intersects( // i have to add 10 pixels width and height, so weird - BRect(333, 16, 354 + fDoubleClickBitmap->Bounds().Width(), - 165 + fAccelerationBitmap->Bounds().Height()))) { - if (fDoubleClickBitmap != NULL) - DrawBitmapAsync(fDoubleClickBitmap, BPoint(344, 16)); - if (fSpeedBitmap != NULL) - DrawBitmapAsync(fSpeedBitmap, BPoint(333, 90)); - if (fAccelerationBitmap != NULL) - DrawBitmapAsync(fAccelerationBitmap, BPoint(333, 155)); - } + BPoint doubleClickBmpPoint(344, 16); + if (fDoubleClickBitmap != NULL + && updateFrame.Intersects(BRect(doubleClickBmpPoint, + doubleClickBmpPoint + fDoubleClickBitmap->Bounds().RightBottom()))) + DrawBitmapAsync(fDoubleClickBitmap, doubleClickBmpPoint); + + BPoint speedBmpPoint(333, 90); + if (fSpeedBitmap != NULL + && updateFrame.Intersects(BRect(speedBmpPoint, + speedBmpPoint + fSpeedBitmap->Bounds().RightBottom()))) + DrawBitmapAsync(fSpeedBitmap, speedBmpPoint); + + BPoint accelerationBmpPoint(333, 155); + if (fAccelerationBitmap != NULL + && updateFrame.Intersects(BRect(accelerationBmpPoint, + accelerationBmpPoint + fAccelerationBitmap->Bounds().RightBottom()))) + DrawBitmapAsync(fAccelerationBitmap, accelerationBmpPoint); + SetDrawingMode(B_OP_COPY); }