Roman Klochkov <[email protected]>
This package provides mixins to make stretchable snips. Stretchable snups have on-size method, that will
be called, when the size of the canvas is changed. It can be used to implement snips, whose view depends on the size of
the editor-canvas, such as horizontal rule.
All stretchable snips should implement stretchable<%> and be placed inside stretchable editor-canvas% (either
stretchable-editor-canvas%, or result of stretchable-editor-canvas-mixin). To implement stretchable<%>
one may use stretchable-snip-mixin or stretchable-snip-static-mixin. If you build stretchable<%>, remember,
that on-size is called only when editor’s on-size is called. If your snip may be added to already shown editor, you
should also override set-admin. See hr% source for example:
canvas-client-size returns correct size of availaible space inside the canvas.
Returns stretchable version of its argument.
should be implemented by all snips, whose on-size
method shoul be called, when editor’s size changes.
This is a snip, that display horizontal rule like <HR> tag in HTML.
Returns stretchable version of its argument with on-size argument.
Returns snip with given on-size method
Returns stretchable version of its argument with call-on-size, called from the on-size method.
Return client width and height for given canvas. Unlike get-client-size
method of window<%>
subtract canvas’s inset and return available to draw space.