AnantLabs / oryx-editor

Automatically exported from code.google.com/p/oryx-editor
Other
1 stars 0 forks source link

when the model is zoomed renameshape plugin shows text box at wrong position #462

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a model
2. zoom in or out
3. doubleclick on element

What is the expected output?
the text box should appear centered above the element

What do you see instead?
the text box appears where the element would be shown if there was no zoom

Please provide any additional information below.
view.js uses 
/* Set Scale-Factor */
canvas.node.setAttributeNS(null, "transform", "scale(" +this.zoomLevel+ ")");
renameshape.js does not take this into account when calculating where to open 
the textfield.
hackfix would be adding 

        var trans = this.facade.getCanvas().rootNode.lastChild.getScreenCTM();
        center.x *= trans.a;
        center.y *= trans.d;
somewhere before creating textfield config in showtextfield() textbox is still 
to big, but then again making textbox to small isnt good idea either.

Original issue reported on code.google.com by goti...@gmail.com on 7 Jan 2011 at 11:50