[Pharo-project] Clipping

Stéphane Ducasse stephane.ducasse at inria.fr
Wed Feb 9 14:57:03 CET 2011


In SMxCanvas>>copyClipRect: aRectangle
	^ self copyOrigin: origin clipRect: (aRectangle translateBy: origin)

SMxFormCanvas>>copyOrigin: aPoint clipRect: aRectangle
	"Return a copy of this canvas with the given origin. The clipping rectangle of this canvas is the intersection of the given rectangle and the receiver's current clipping rectangle. This allows the clipping rectangles of nested clipping morphs to be composed."
	^ self copy
		setOrigin: aPoint
		clipRect: (clipRect intersect: aRectangle)

Canvas>>copyClipRect: newClipRect

	^ ClippingCanvas canvas: self clipRect: newClipRect

FormCanvas>>copyOrigin: aPoint clipRect: aRectangle
	"Return a copy of this canvas with the given origin. The clipping rectangle of this canvas is the intersection of the given rectangle and the receiver's current clipping rectangle. This allows the clipping rectangles of nested clipping morphs to be composed."
	^ self copy
		setOrigin: aPoint
		clipRect: (clipRect intersect: aRectangle)


Do you think that we can remove ClippingCanvas. There are too many canvases in Pharo.

Stef



More information about the Pharo-project mailing list