~juju-gui/juju-gui/trunk

Viewing all changes in revision 255.

  • Committer: Matthew Scott
  • Date: 2012-11-21 17:35:31 UTC
  • mfrom: (251.2.4 adding-subordinates)
  • Revision ID: matthew.scott@canonical.com-20121121173531-b1dgunxrajc0skya
Fix initial creation of subordinates.

When creating a subordinate service initially, it was not being laid out properly by the pack layout, nor was it seeming to have drag events attached.  Pack layout was expecting a value accessor function to return some number greater than zero when constructing its radius, which informs the x/y coordinates.  Returning zero results in NaN for all three values, thus positioning the service at (0,0) and causing drag events to fail when updating the service's coordinates with dx/dy + NaN.  This branch fixes this by ensuring that zero is never returned as the node's value.  This fix is quick and intended to make the UI function with the current layout algorithm.  Future layout algorithms, if they're designed by hand, will need to keep this in mind as well.

R=benjamin.saller, bac
CC=
https://codereview.appspot.com/6856067

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: