mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-13 00:04:19 +00:00
OpenGL: Take a Component's transform into account when painting
This commit is contained in:
parent
249ab04f76
commit
515f4846a5
1 changed files with 6 additions and 2 deletions
|
|
@ -289,10 +289,13 @@ public:
|
|||
.withZeroOrigin()
|
||||
* newScale;
|
||||
|
||||
if (scale != newScale || viewportArea != newArea)
|
||||
auto newTransform = component.getTransform();
|
||||
|
||||
if (scale != newScale || viewportArea != newArea || transform != newTransform)
|
||||
{
|
||||
scale = newScale;
|
||||
viewportArea = newArea;
|
||||
transform = newTransform;
|
||||
|
||||
if (canTriggerUpdate)
|
||||
invalidateAll();
|
||||
|
|
@ -335,7 +338,7 @@ public:
|
|||
{
|
||||
ScopedPointer<LowLevelGraphicsContext> g (createOpenGLGraphicsContext (context, cachedImageFrameBuffer));
|
||||
g->clipToRectangleList (invalid);
|
||||
g->addTransform (AffineTransform::scale ((float) scale));
|
||||
g->addTransform (transform.followedBy (AffineTransform::scale ((float) scale)));
|
||||
|
||||
paintOwner (*g);
|
||||
JUCE_CHECK_OPENGL_ERROR
|
||||
|
|
@ -619,6 +622,7 @@ public:
|
|||
RectangleList<int> validArea;
|
||||
Rectangle<int> viewportArea, lastScreenBounds;
|
||||
double scale = 1.0;
|
||||
AffineTransform transform;
|
||||
#if JUCE_OPENGL3
|
||||
GLuint vertexArrayObject = 0;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue