Overview

When moving the 2D view rectangle in paperspace users would experience significant lag due to a costly rebuild2D invalidation call each frame. This lag is mitigated by instead running the rebuild in the snappers' updateContent method.

Runtime/Behavior Changes

We introduce a flag which will be set each frame to indicate if the content should be rebuild or not:

cm/core/xclip/xclipWormholeSnapper2D.cm

    added:
    /**
     * Invalidate clipped snappers.
     */
     public bool inv_clippedGraphicSnappers : copy=null, stream=null, ignore modify notice;


    added:
    /**
     * Update 'scene' to show 'objs'.
     */
    public void updateContent(XClipScene scene, Object{} objs) {
	if (inv_clippedGraphicSnappers) {
	    content2D.?invalidateClippedGraphicsSnappers();
	    inv_clippedGraphicSnappers = false;
	}
	super(..);
    }

We also changed the invalidation to simply set this flag instead of running a costly method each frame:

    old: public void invalidate_clipContent() { inv_clipContent = true; content2D.?invalidateClippedGraphicsSnappers(); inv_beforeMaster	 = true; }


    new: public void invalidate_clipContent() { inv_clipContent = true; inv_clippedGraphicSnappers = true; inv_beforeMaster = true;}