Mercurial > hg > orthanc-stone
diff Framework/Scene2D/Scene2D.cpp @ 1380:6ea4062c1a0d broker
Integration from default into broker
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 22 Apr 2020 14:05:12 +0200 |
parents | 257f2c9a02ac 1e4878ed1d77 |
children | 30deba7bc8e2 |
line wrap: on
line diff
--- a/Framework/Scene2D/Scene2D.cpp Wed Apr 22 14:02:34 2020 +0200 +++ b/Framework/Scene2D/Scene2D.cpp Wed Apr 22 14:05:12 2020 +0200 @@ -222,22 +222,29 @@ canvasToScene_ = inverse; } + void Scene2D::GetBoundingBox(Extent2D &target) const + { + target.Reset(); + + for (Content::const_iterator it = content_.begin(); + it != content_.end(); ++it) + { + assert(it->second != NULL); + + Extent2D tmp; + if (it->second->GetLayer().GetBoundingBox(tmp)) + { + target.Union(tmp); + } + } + } + void Scene2D::FitContent(unsigned int canvasWidth, unsigned int canvasHeight) { Extent2D extent; - for (Content::const_iterator it = content_.begin(); - it != content_.end(); ++it) - { - assert(it->second != NULL); - - Extent2D tmp; - if (it->second->GetLayer().GetBoundingBox(tmp)) - { - extent.Union(tmp); - } - } + GetBoundingBox(extent); if (!extent.IsEmpty()) {