mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Linux: Adjust natively reported border size by the current scale factor
This commit is contained in:
parent
338c045719
commit
6f3fb5a29f
2 changed files with 17 additions and 1 deletions
|
|
@ -145,6 +145,16 @@ public:
|
|||
other.right + right };
|
||||
}
|
||||
|
||||
/** Multiplies each member of the border by a scalar. */
|
||||
template <typename ScalarType>
|
||||
BorderSize<ValueType> multipliedBy (ScalarType scalar) const noexcept
|
||||
{
|
||||
return { static_cast<ValueType> (scalar * top),
|
||||
static_cast<ValueType> (scalar * left),
|
||||
static_cast<ValueType> (scalar * bottom),
|
||||
static_cast<ValueType> (scalar * right) };
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool operator== (const BorderSize& other) const noexcept { return tie() == other.tie(); }
|
||||
bool operator!= (const BorderSize& other) const noexcept { return tie() != other.tie(); }
|
||||
|
|
|
|||
|
|
@ -380,7 +380,13 @@ public:
|
|||
else if (! windowBorder
|
||||
|| ((*windowBorder).getTopAndBottom() == 0 && (*windowBorder).getLeftAndRight() == 0))
|
||||
{
|
||||
windowBorder = XWindowSystem::getInstance()->getBorderSize (windowH);
|
||||
windowBorder = [&]()
|
||||
{
|
||||
if (auto unscaledBorderSize = XWindowSystem::getInstance()->getBorderSize (windowH))
|
||||
return OptionalBorderSize { (*unscaledBorderSize).multipliedBy (1.0 / currentScaleFactor) };
|
||||
|
||||
return OptionalBorderSize {};
|
||||
}();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue