From: nds Date: Fri, 31 Oct 2014 05:54:08 +0000 (+0300) Subject: refs #193: OCC viwer problems when move line X-Git-Tag: V_0.5~59 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3e2000ab472f5885de9ce1fbe1e2eb27669b5596;p=modules%2Fshaper.git refs #193: OCC viwer problems when move line A fix to avoid black-colored window. --- diff --git a/src/NewGeom/NewGeom_SalomeViewer.cpp b/src/NewGeom/NewGeom_SalomeViewer.cpp index d9ce85feb..a455bc183 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.cpp +++ b/src/NewGeom/NewGeom_SalomeViewer.cpp @@ -123,6 +123,11 @@ void NewGeom_SalomeViewer::onKeyRelease(SUIT_ViewWindow*, QKeyEvent* theEvent) void NewGeom_SalomeViewer::enableSelection(bool isEnabled) { mySelector->viewer()->enableSelection(isEnabled); + // there is a fix for a black-colored window + // the viewer rubber band is valid if the values delta is less than 1 + // TODO: remove this row after moving to SALOME 7.5 + mySelector->viewer()->setInteractionStyle(isEnabled ? SUIT_ViewModel::STANDARD + : SUIT_ViewModel::KEY_FREE); } //********************************************** diff --git a/src/XGUI/XGUI_ViewWindow.cpp b/src/XGUI/XGUI_ViewWindow.cpp index b64386288..78c7f7195 100644 --- a/src/XGUI/XGUI_ViewWindow.cpp +++ b/src/XGUI/XGUI_ViewWindow.cpp @@ -22,6 +22,8 @@ #include #include +#include + #define BORDER_SIZE 2 const char* imageZoomCursor[] = { "32 32 3 1", ". c None", "a c #000000", "# c #ffffff", @@ -871,6 +873,16 @@ 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); }