We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Konva version: 9.3.18
9.3.18
Group.getClientRect({ relativeTo: stage }) returns unexpected results when the Group contains a Transformer and the Stage has been dragged.
Group.getClientRect({ relativeTo: stage })
Group
Transformer
Stage
Please see the code below which renders:
Circle
Rect
Instructions:
If the Group does not contain the Transformer then this does not happen.
This seems like a bug... but maybe I am missing something?
Thanks!
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/[email protected]/konva.min.js"></script> <meta charset="utf-8" /> <style> body { margin:0; padding:0; overflow:hidden; background-color:#f0f0f0; } </style> </head> <body> <div id="container"></div> <script> var stage = new Konva.Stage({ container: 'container', width: window.innerWidth, height: window.innerHeight, draggable: true }); var layer = new Konva.Layer(); stage.add(layer); var rect = new Konva.Rect({ stroke: 'black', strokeWidth: 1, }); layer.add(rect); var group = new Konva.Group(); layer.add(group); var greenCircle = new Konva.Circle({ x: 200, y: 200, radius: 20, fill: 'green', draggable: false, }); group.add(greenCircle); var redCircle = new Konva.Circle({ x: 100, y: 100, radius: 40, fill: 'red', draggable: true, }); group.add(redCircle); var transformer = new Konva.Transformer({ nodes: [redCircle], }); group.add(transformer); redCircle.on('dragend transformend', function() { var clientRect = group.getClientRect({ relativeTo: stage }); rect.x(clientRect.x); rect.y(clientRect.y); rect.width(clientRect.width); rect.height(clientRect.height); }); </script> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
Konva version:
9.3.18
Group.getClientRect({ relativeTo: stage })
returns unexpected resultswhen the
Group
contains aTransformer
and the
Stage
has been dragged.Please see the code below which renders:
Stage
(draggable)Group
which contains:Circle
greenCircle
red (draggable)Transformer
for the redCircle
Rect
black which displays the result ofGroup.getClientRect({ relativeTo: stage })
Instructions:
If the
Group
does not contain theTransformer
then this does not happen.This seems like a bug... but maybe I am missing something?
Thanks!
The text was updated successfully, but these errors were encountered: