Mercurial > hg > orthanc-stone
diff Framework/Widgets/LayerWidget.cpp @ 109:53bd9277b025 wasm
using the Extent class
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Jun 2017 15:34:08 +0200 |
parents | 474d85e76499 |
children | 53025eecbc95 |
line wrap: on
line diff
--- a/Framework/Widgets/LayerWidget.cpp Wed Jun 14 15:13:32 2017 +0200 +++ b/Framework/Widgets/LayerWidget.cpp Wed Jun 14 15:34:08 2017 +0200 @@ -232,10 +232,7 @@ } - void LayerWidget::GetSceneExtent(double& x1, - double& y1, - double& x2, - double& y2) + Extent LayerWidget::GetSceneExtent() { Extent sceneExtent; @@ -248,36 +245,7 @@ sceneExtent.Union(layerExtent); } - if (sceneExtent.IsEmpty()) - { - // Set a default extent of (-1,-1) -> (0,0) - x1 = -1; - y1 = -1; - x2 = 1; - y2 = 1; - } - else - { - x1 = sceneExtent.GetX1(); - y1 = sceneExtent.GetY1(); - x2 = sceneExtent.GetX2(); - y2 = sceneExtent.GetY2(); - - // Ensure the extent is non-empty - if (x1 >= x2) - { - double tmp = x1; - x1 = tmp - 0.5; - x2 = tmp + 0.5; - } - - if (y1 >= y2) - { - double tmp = y1; - y1 = tmp - 0.5; - y2 = tmp + 0.5; - } - } + return sceneExtent; }