Eric
unread,Aug 4, 2011, 10:59:56 PM8/4/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to coreplot-discuss
To fix issues 125 and 289, I changed the way the constraints on
floating axes are handled. Instead of using a simple struts-and-
springs constraint model, there is now a class called "CPTConstraints"
that controls the positioning. The "constraints" property was also
renamed to "axisConstraints" because the old name was masking the
existing (Mac only) CALayer property. The example apps have been
updated to use the new constraint model and CPTLayerAnnotation also
uses them internally if you need more examples.
CPTConstraints allows two basic types of constraint. Note that when
used for floating axis positioning, the axis doesn't clip the
constrained position to the visible area so it is possible to use an
offset that will push the floating axis outside the visible area.
1. Fixed offset from either the lower or upper bound of the range.
Note that for axes, this range is in view coordinates, so the lower
bound is to the left for a horizontal axis and at the bottom for a
vertical axis. The offset is towards the middle of the range, so a
positive offset from the lower bound goes in the positive direction
but a positive offset from the upper bound goes in a negative
direction.
2. Relative offset. This is used to maintain a position that is a
certain fraction of the range--0.0 is the lower bound, 1.0 is the
upper bound, and 0.5 is the middle. It is not restricted to these
values; any CGFloat value can be used.
CPTConstraints is immutable, so you have to create a new object
whenever you want to change the constraints.
Eric