File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ const setVisibility = (element: SVGElement, visible: boolean) => {
3232
3333/**
3434 * Manages the SVG elements for the cat face.
35- * This class holds the persistent SVG elements and manages events (blinking, etc.),
36- * but layout is driven by the Drawer/RenderInfo .
35+ * This class holds the persistent SVG elements and manages events (blinking, etc.)
36+ * Owned by the PathObject with similar lifetime .
3737 */
3838export class CatFace {
3939 faceGroup_ : SVGElement ;
@@ -43,9 +43,7 @@ export class CatFace {
4343 renderer_ : CatScratchRenderer ;
4444 block_ : Blockly . BlockSvg ;
4545
46- constructor (
47- info : RenderInfo ,
48- ) {
46+ constructor ( info : RenderInfo ) {
4947 this . constants_ = info . constants_ ;
5048 this . renderer_ = info . renderer_ ;
5149 this . block_ = info . block_ ;
@@ -99,6 +97,11 @@ export class CatFace {
9997 } ) ;
10098 }
10199
100+ /**
101+ * Asks the renderer to re-render the block at a time when it normally wouldn't.
102+ * Necessary if the path geometry has changed (ear flicks).
103+ * Not necessary for face changes (blinking).
104+ */
102105 private triggerRedraw ( ) {
103106 this . renderer_ . render ( this . block_ ) ;
104107 }
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ export enum PathEarState {
1818
1919export interface CatPathState {
2020 capType : PathCapType ;
21- ear1State : PathEarState ;
22- ear2State : PathEarState ;
21+ ear1State : PathEarState ; // Left ear in LTR, right in RTL
22+ ear2State : PathEarState ; // Right ear in LTR, left in RTL
2323}
2424
2525export class ConstantProvider extends ClassicConstantProvider {
You can’t perform that action at this time.
0 commit comments