summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindow.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-05-29 20:41:10 +0000
committerDon Kjer <don@lindenlab.com>2012-05-29 20:41:10 +0000
commit2d3790b2396534de096244bf7b7660ec5ec3a139 (patch)
tree1cbe6616b0f1ef728370b73ad453857caf2eb53e /indra/llwindow/llwindow.cpp
parent2a62ca5b96d08ad2f24e8a60e161657a7222aba6 (diff)
parenta519e34f02b4b2663fe082ba9ad12f1b423669cb (diff)
Merge ssh://hg@bitbucket.org/lindenlab/viewer-release -> viewer-eventapi-fixes
Diffstat (limited to 'indra/llwindow/llwindow.cpp')
-rw-r--r--indra/llwindow/llwindow.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 6834b34387..5b7424acbb 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -192,6 +192,21 @@ BOOL LLWindow::setSize(LLCoordScreen size)
return setSizeImpl(size);
}
+BOOL LLWindow::setSize(LLCoordWindow size)
+{
+ //HACK: we are inconsistently using minimum window dimensions
+ // in this case, we are constraining the inner "client" rect and other times
+ // we constrain the outer "window" rect
+ // There doesn't seem to be a good way to do this consistently without a bunch of platform
+ // specific code
+ if (!getMaximized())
+ {
+ size.mX = llmax(size.mX, mMinWindowWidth);
+ size.mY = llmax(size.mY, mMinWindowHeight);
+ }
+ return setSizeImpl(size);
+}
+
// virtual
void LLWindow::setMinSize(U32 min_width, U32 min_height, bool enforce_immediately)
@@ -440,7 +455,7 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window)
//coordinate conversion utility funcs that forward to llwindow
LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
{
- const LLCoordWindow& self = static_cast<const LLCoordWindow&>(*this);
+ const LLCoordWindow& self = LLCoordWindow::getTypedCoords(*this);
LLWindow* windowp = &(*LLWindow::beginInstances());
LLCoordGL out;
@@ -450,7 +465,7 @@ LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
{
- LLCoordWindow& self = static_cast<LLCoordWindow&>(*this);
+ LLCoordWindow& self = LLCoordWindow::getTypedCoords(*this);
LLWindow* windowp = &(*LLWindow::beginInstances());
LLCoordGL from_gl(from);
@@ -459,7 +474,7 @@ void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
{
- const LLCoordScreen& self = static_cast<const LLCoordScreen&>(*this);
+ const LLCoordScreen& self = LLCoordScreen::getTypedCoords(*this);
LLWindow* windowp = &(*LLWindow::beginInstances());
LLCoordGL out;
@@ -469,7 +484,7 @@ LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from)
{
- LLCoordScreen& self = static_cast<LLCoordScreen&>(*this);
+ LLCoordScreen& self = LLCoordScreen::getTypedCoords(*this);
LLWindow* windowp = &(*LLWindow::beginInstances());
LLCoordGL from_gl(from);