On 31/12/18 1:54 AM, Steve Quezadas wrote:
> I am experimenting with pharo right now, particularly with Morphs. The
> weird thing is that some morphs can have a rotation halo and others do not.
>
> This has a "rotate halo":
> bar := EllipseMorph new.
> bar openInWorld.
>
> This does not:
> foo := Morph new.
> foo openInWorld
A morph has to implement #prepareToRotate method for rotate Halo button
to appear and also implement rotationDegrees: method to do the actual
transformation. Otherwise, you can add a flex shell to the morph and
request it to rotate it.
Morph does not support rotation, so there is no rotation button in its
halo. EllipseMorph has a dummy rotationDegrees: method. CircleMorph and
PolygonMorph go the whole way.
foo := Morph new addFlexShell openCenteredInWorld
foo topRendererOrSelf rotationDegrees: 45
bar := (PolygonMorph
vertices: {261@400. 388@519. 302@595}
color: Color blue
borderWidth: 2
borderColor: Color black) openInWorld.
bar rotationDegrees: 45
HTH .. Subbu