Mixin: SC.InnerFrame
InnerFrame provides the innerFrameForSize function, which will return a frame for the given size adjusted
to fit within the given outer size, according to the align and scale properties.
View's that render images will find this mixin particularly useful for fitting their images.
Defined in: inner_frame.js
Field Summary
Class Methods
Field Detail
SC.InnerFrame.align StringAlign the shape within its frame. Possible values:
SC.ALIGN_TOP_LEFTSC.ALIGN_TOPSC.ALIGN_TOP_RIGHTSC.ALIGN_LEFTSC.ALIGN_CENTERSC.ALIGN_RIGHTSC.ALIGN_BOTTOM_LEFTSC.ALIGN_BOTTOMSC.ALIGN_BOTTOM_RIGHT
- Default value:
- SC.ALIGN_CENTER
Determines how the shape will scale to fit within its containing space. Possible values:
SC.SCALE_NONESC.FILLSC.BEST_FILLSC.BEST_FITSC.BEST_FIT_DOWN_ONLY
- Default value:
- SC.FILL
Class Method Detail
Returns a frame (x, y, width, height) fitting the source size (sourceWidth & sourceHeight) within the
destination size (destWidth & destHeight) according to the align and scale properties. This is essential to
positioning child views or elements within parent views or elements in elegant ways.
- Parameters:
- sourceWidth Number
- sourceHeight Number
- destWidth Number
- destHeight Number
- Returns:
- Object
- the inner frame with properties: {x: value, y: value, width: value, height: value }
