mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
D2D: Update Direct2DGraphicsContext::getPhysicalPixelScaleFactor to include context transform for consistency with other renderer backends
This commit is contained in:
parent
c2d86693ff
commit
203e99c57d
2 changed files with 6 additions and 10 deletions
|
|
@ -946,11 +946,6 @@ void Direct2DGraphicsContext::excludeClipRectangle (const Rectangle<int>& userSp
|
|||
}
|
||||
}
|
||||
|
||||
void Direct2DGraphicsContext::setPhysicalPixelScaleFactor (float f)
|
||||
{
|
||||
scale = f;
|
||||
}
|
||||
|
||||
void Direct2DGraphicsContext::resetPendingClipList()
|
||||
{
|
||||
auto& transform = currentState->currentTransform;
|
||||
|
|
@ -1403,7 +1398,12 @@ const Font& Direct2DGraphicsContext::getFont()
|
|||
|
||||
float Direct2DGraphicsContext::getPhysicalPixelScaleFactor() const
|
||||
{
|
||||
return scale;
|
||||
if (currentState != nullptr)
|
||||
return currentState->currentTransform.getPhysicalPixelScaleFactor();
|
||||
|
||||
// If this is hit, there's no frame in progress, so the scale factor isn't meaningful
|
||||
jassertfalse;
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void Direct2DGraphicsContext::drawRoundedRectangle (const Rectangle<float>& area, float cornerSize, float lineThickness)
|
||||
|
|
|
|||
|
|
@ -113,9 +113,6 @@ public:
|
|||
static int constexpr minFrameSize = 1;
|
||||
static int constexpr maxFrameSize = 16384;
|
||||
|
||||
//==============================================================================
|
||||
void setPhysicalPixelScaleFactor (float);
|
||||
|
||||
protected:
|
||||
struct SavedState;
|
||||
SavedState* currentState = nullptr;
|
||||
|
|
@ -170,7 +167,6 @@ protected:
|
|||
};
|
||||
|
||||
uint64_t frame = 0;
|
||||
float scale = 1.0f;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Direct2DGraphicsContext)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue