Fixed Linux specific rendering bug

This commit is contained in:
OmniaX-Dev 2026-04-19 11:26:33 +02:00
parent 63d00adf96
commit a20e5849f5
4 changed files with 9 additions and 4 deletions

View file

@ -23,6 +23,7 @@
Add theme caching
Implement cursors in Stylesheet
FIX: Window getting exponentially bigger when Desktop scale changes
FIX: Refreshing scroll when content extent changes

View file

@ -1 +1 @@
2070
2071

View file

@ -323,7 +323,7 @@ namespace ogfx
{
if (isVScrollAllowed())
{
bool mouseInsideHScrollbar = m_hScrollbar.isMouseInsideThumb({ event.mouse->position_x, event.mouse->position_y });
bool mouseInsideHScrollbar = m_hScrollbar.isMouseInsideThumb({ event.mouse->position_x, event.mouse->position_y }) && needsHScroll();
if (std::abs(event.mouse->scrollAmount.y) > 0 && !mouseInsideHScrollbar)
{
m_scrollVelocity.y += m_scrollSpeed * event.mouse->scrollAmount.y * m_scrollSpeedMultiplier;

View file

@ -110,6 +110,7 @@ namespace ogfx
{
if (!child || child->isInvalid()) continue;
if (child->isIgnoreScrollAllowed()) continue;
if (!child->isVisible()) continue;
Vec2 localPos = getPadding().getPosition() + child->getPosition() + child->getMargin().getPosition() + child->getContentBounds().getPosition();
maxX = std::max(maxX, localPos.x + child->getw() + child->getMargin().w);
maxY = std::max(maxY, localPos.y + child->geth() + child->getMargin().h);
@ -230,10 +231,13 @@ namespace ogfx
onDraw(gfx);
// gfx.fillRect(getGlobalPureContentBounds(), { 0, 255, 0, 120 });
gfx.pushClippingRect(getGlobalPureContentBounds(), true);
const bool needsContentClip = !m_rootChild;
if (needsContentClip)
gfx.pushClippingRect(getGlobalPureContentBounds(), true);
if (hasChildren())
m_widgets.draw(gfx);
gfx.popClippingRect();
if (needsContentClip)
gfx.popClippingRect();
if (m_showBorder)
gfx.drawRoundRect({ getGlobalPosition(), getSize() }, m_borderColor, m_borderRadius, m_borderWidth);
afterDraw(gfx);