mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a couple of rendering problems when using global scale factors.
This commit is contained in:
parent
9b4566a2f0
commit
94da373c31
3 changed files with 14 additions and 8 deletions
|
|
@ -138,8 +138,7 @@ File AvailableModuleList::getModulesFolderForJuceOrModulesFolder (const File& f)
|
|||
File AvailableModuleList::getModulesFolderForExporter (const ProjectExporter& exporter)
|
||||
{
|
||||
File f (exporter.getProject().resolveFilename (exporter.getJuceFolderString()));
|
||||
f = getModulesFolderForJuceOrModulesFolder (f);
|
||||
return f;
|
||||
return getModulesFolderForJuceOrModulesFolder (f);
|
||||
}
|
||||
|
||||
File AvailableModuleList::getDefaultModulesFolder (Project* project)
|
||||
|
|
|
|||
|
|
@ -1872,9 +1872,14 @@ void Component::internalRepaintUnchecked (const Rectangle<int>& area, const bool
|
|||
CHECK_MESSAGE_MANAGER_IS_LOCKED
|
||||
|
||||
if (ComponentPeer* const peer = getPeer())
|
||||
peer->repaint (ComponentHelpers::scaledScreenPosToUnscaled (*this,
|
||||
affineTransform != nullptr ? area.transformedBy (*affineTransform)
|
||||
: area));
|
||||
{
|
||||
// Tweak the scaling so that the component's integer size exactly aligns with the peer's scaled size
|
||||
const Rectangle<int> peerBounds (peer->getBounds());
|
||||
const Rectangle<int> scaled (area * Point<float> (peerBounds.getWidth() / (float) getWidth(),
|
||||
peerBounds.getHeight() / (float) getHeight()));
|
||||
|
||||
peer->repaint (affineTransform != nullptr ? scaled.transformedBy (*affineTransform) : scaled);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -111,10 +111,12 @@ void ComponentPeer::handlePaint (LowLevelGraphicsContext& contextToPaintTo)
|
|||
if (component.isTransformed())
|
||||
g.addTransform (component.getTransform());
|
||||
|
||||
const float masterScale = component.getDesktopScaleFactor();
|
||||
const Rectangle<int> peerBounds (getBounds());
|
||||
|
||||
if (masterScale != 1.0f)
|
||||
g.addTransform (AffineTransform::scale (masterScale));
|
||||
if (peerBounds.getWidth() != component.getWidth() || peerBounds.getHeight() != component.getHeight())
|
||||
// Tweak the scaling so that the component's integer size exactly aligns with the peer's scaled size
|
||||
g.addTransform (AffineTransform::scale (peerBounds.getWidth() / (float) component.getWidth(),
|
||||
peerBounds.getHeight() / (float) component.getHeight()));
|
||||
|
||||
#if JUCE_ENABLE_REPAINT_DEBUGGING
|
||||
g.saveState();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue