From 7712a61be2bf96a49393b81dd0f7988355cac090 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 31 Oct 2014 11:09:18 +0300 Subject: [PATCH] refs #193: OCC viwer problems when move line A fix to avoid black-colored window. A fix from the SALOME 7.5. --- src/XGUI/XGUI_RubberBand.cpp | 3 ++- src/XGUI/XGUI_ViewWindow.cpp | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/XGUI/XGUI_RubberBand.cpp b/src/XGUI/XGUI_RubberBand.cpp index 1ed0d5f32..390368256 100644 --- a/src/XGUI/XGUI_RubberBand.cpp +++ b/src/XGUI/XGUI_RubberBand.cpp @@ -137,7 +137,8 @@ void XGUI_AbstractRubberBand::updateMask() if (isClosed()) r += createRegion(myPoints.last(), myPoints.first()); - setMask(r); + if (!r.isEmpty()) + setMask(r); } //********************************************************** diff --git a/src/XGUI/XGUI_ViewWindow.cpp b/src/XGUI/XGUI_ViewWindow.cpp index 78c7f7195..b07d4676a 100644 --- a/src/XGUI/XGUI_ViewWindow.cpp +++ b/src/XGUI/XGUI_ViewWindow.cpp @@ -873,16 +873,6 @@ void XGUI_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent) */ void XGUI_ViewWindow::drawRect() { - // there is a fix for a black-colored window - // the rubber band is valid if the values delta is less than 1 - // TODO: move this fix to the RectRubberBand according to SALOME 7.5 - double aDeltaX = fabs((float)(myStartX-myCurrX)); - double aDeltaY = fabs((float)(myStartY-myCurrY)); - if (aDeltaX <= 1 || aDeltaY == 1) { - endDrawRect(); - return; - } - if (!myRectBand) { myRectBand = new XGUI_RectRubberBand(myViewPort); } -- 2.39.2