"self changed" will invalidate the entire morph area.
"self invalidRect: rect" will only invalid the specified rectangle.

For the second question I'm not entirely sure that's true? 

For historic reasons Morphic uses global coords even though most other rendering frameworks use parent-relative coordinates (I think Cuis may have fixed that, not sure).
If I write a morph that always draws starting at 0@0 then it's always drawn in the top-left screen corner (though it might not be visible there unless that area gets invalidated).

However – the HandMorph paints its submorphs into a caching canvas, so they don't have to be redrawn for every mouse move. If you never invalidate your morph then it is only drawn once into that canvas and then it looks like it's being dragged around. But if the morph updates, e.g. you call "self changed" in your drawOn: method (don't do that! only for testing) then you will see that even while being dragged in the hand, it will always be drawn in the top-left screen corner.

On the other hand (pun intended), if you are using OpenGL (are you?) then it's not actually drawn into the world but the 3D window is an overlay that gets moved around, and the 3D content would move with that window even though it is drawn relative to 0@0.

HTH,
Vanessa

On Fri, Mar 29, 2024 at 12:23 PM Lauren Pullen <drurowin@gmail.com> wrote:
Hi List,

Easy question first.  #refreshWorld warns not to use it often because of
damage recording... but it doesn't say what to use instead.  What is the
correct method to mark a morph damaged?

(I'm rendering a static 3D scene with a movable camera, so I only need
to redraw it on demand by the camera.)

Whenever I draw on a morph I always forget I need to offset coordinates
by the morph's origin, so things end up getting drawn in the top left.
I tend to open morphs in hand, so it draws correctly until I drop it
back into the world.

Why does the canvas in #drawOn: have a different origin depending on if
you're holding the morph or not?