|
|
|
@@ -707,26 +707,21 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const |
|
|
|
else if (needsFullViewportForDrawing || (absolutePos.isZero() && self->getSize() == Size<uint>(width, height))) |
|
|
|
{ |
|
|
|
// full viewport size |
|
|
|
glViewport(0, |
|
|
|
-static_cast<int>(height * autoScaleFactor - height + 0.5), |
|
|
|
static_cast<int>(width * autoScaleFactor + 0.5), |
|
|
|
static_cast<int>(height * autoScaleFactor + 0.5)); |
|
|
|
glViewport(0, 0, static_cast<int>(width), static_cast<int>(height)); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// set viewport pos |
|
|
|
glViewport(static_cast<int>(absolutePos.getX() * autoScaleFactor + 0.5), |
|
|
|
-static_cast<int>(std::round((height * autoScaleFactor - height) |
|
|
|
+ (absolutePos.getY() * autoScaleFactor))), |
|
|
|
static_cast<int>(std::round(width * autoScaleFactor)), |
|
|
|
static_cast<int>(std::round(height * autoScaleFactor))); |
|
|
|
-static_cast<int>(absolutePos.getY() * autoScaleFactor + 0.5), |
|
|
|
static_cast<int>(width), |
|
|
|
static_cast<int>(height)); |
|
|
|
|
|
|
|
// then cut the outer bounds |
|
|
|
glScissor(static_cast<int>(absolutePos.getX() * autoScaleFactor + 0.5), |
|
|
|
static_cast<int>(height - std::round((static_cast<int>(self->getHeight()) + absolutePos.getY()) |
|
|
|
* autoScaleFactor)), |
|
|
|
static_cast<int>(std::round(self->getWidth() * autoScaleFactor)), |
|
|
|
static_cast<int>(std::round(self->getHeight() * autoScaleFactor))); |
|
|
|
static_cast<int>(height - (self->getHeight() + absolutePos.getY()) * autoScaleFactor + 0.5), |
|
|
|
static_cast<int>(self->getWidth() * autoScaleFactor + 0.5), |
|
|
|
static_cast<int>(self->getHeight() * autoScaleFactor + 0.5)); |
|
|
|
|
|
|
|
glEnable(GL_SCISSOR_TEST); |
|
|
|
needsDisableScissor = true; |
|
|
|
@@ -752,26 +747,14 @@ void TopLevelWidget::PrivateData::display() |
|
|
|
const uint width = size.getWidth(); |
|
|
|
const uint height = size.getHeight(); |
|
|
|
|
|
|
|
const double autoScaleFactor = window.pData->autoScaleFactor; |
|
|
|
|
|
|
|
// full viewport size |
|
|
|
if (window.pData->autoScaling) |
|
|
|
{ |
|
|
|
glViewport(0, |
|
|
|
-static_cast<int>(height * autoScaleFactor - height + 0.5), |
|
|
|
static_cast<int>(width * autoScaleFactor + 0.5), |
|
|
|
static_cast<int>(height * autoScaleFactor + 0.5)); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
glViewport(0, 0, static_cast<int>(width), static_cast<int>(height)); |
|
|
|
} |
|
|
|
glViewport(0, 0, static_cast<int>(width), static_cast<int>(height)); |
|
|
|
|
|
|
|
// main widget drawing |
|
|
|
self->onDisplay(); |
|
|
|
|
|
|
|
// now draw subwidgets if there are any |
|
|
|
selfw->pData->displaySubWidgets(width, height, autoScaleFactor); |
|
|
|
selfw->pData->displaySubWidgets(width, height, window.pData->autoScaleFactor); |
|
|
|
} |
|
|
|
|
|
|
|
// ----------------------------------------------------------------------- |
|
|
|
|