Hi
How should I structure my markup to support automatic
re-sizing of a parent element as child elements gets added?
I am using the Discrete Event demo as my starting point.
markup: '<g
class="rotatable"><g
class="scalable"><rect/></g><text
class="label"/><g class="inPorts"/><g
class="outPorts"/></g>',
portMarkup: '<g class="port<%= id %>"><circle/><text/></g>',
Instead of keeping the rect height static and uniformly adding the inPorts, I want the rect height to grow to accommodate any number of inPorts.
This has been my approach inside the View's render function :
Render the inPorts as normal, (call list addPorts with list of inPorts)
get the bbox of the <g> wrapping all inPorts, now that they have been rendered
change the rect’s height and width, getting a reference from this.model.get('attrs')
However the rect is inside a scalable group, and when I inspect the elements I can see that scale has been set as follows:
<g class="scalable" id="v_18"
transform="scale(0.9333333333333333,0.72)">
This means that the rect only covers 93% of the inPort’s
height and 72% of the inPorts width.
Feels like my approach is wrong.
Aidan
--
---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.