mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-17 00:44: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()
|
.withZeroOrigin()
|
||||||
* newScale;
|
* newScale;
|
||||||
|
|
||||||
if (scale != newScale || viewportArea != newArea)
|
auto newTransform = component.getTransform();
|
||||||
|
|
||||||
|
if (scale != newScale || viewportArea != newArea || transform != newTransform)
|
||||||
{
|
{
|
||||||
scale = newScale;
|
scale = newScale;
|
||||||
viewportArea = newArea;
|
viewportArea = newArea;
|
||||||
|
transform = newTransform;
|
||||||
|
|
||||||
if (canTriggerUpdate)
|
if (canTriggerUpdate)
|
||||||
invalidateAll();
|
invalidateAll();
|
||||||
|
|
@ -335,7 +338,7 @@ public:
|
||||||
{
|
{
|
||||||
ScopedPointer<LowLevelGraphicsContext> g (createOpenGLGraphicsContext (context, cachedImageFrameBuffer));
|
ScopedPointer<LowLevelGraphicsContext> g (createOpenGLGraphicsContext (context, cachedImageFrameBuffer));
|
||||||
g->clipToRectangleList (invalid);
|
g->clipToRectangleList (invalid);
|
||||||
g->addTransform (AffineTransform::scale ((float) scale));
|
g->addTransform (transform.followedBy (AffineTransform::scale ((float) scale)));
|
||||||
|
|
||||||
paintOwner (*g);
|
paintOwner (*g);
|
||||||
JUCE_CHECK_OPENGL_ERROR
|
JUCE_CHECK_OPENGL_ERROR
|
||||||
|
|
@ -619,6 +622,7 @@ public:
|
||||||
RectangleList<int> validArea;
|
RectangleList<int> validArea;
|
||||||
Rectangle<int> viewportArea, lastScreenBounds;
|
Rectangle<int> viewportArea, lastScreenBounds;
|
||||||
double scale = 1.0;
|
double scale = 1.0;
|
||||||
|
AffineTransform transform;
|
||||||
#if JUCE_OPENGL3
|
#if JUCE_OPENGL3
|
||||||
GLuint vertexArrayObject = 0;
|
GLuint vertexArrayObject = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue