Skip to content

Commit 1f2a54f

Browse files
authored
Improve variable comments in TurtlesView for better code clarity (#4367)
1 parent 878d78e commit 1f2a54f

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

js/turtles.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -568,25 +568,22 @@ Turtles.TurtlesView = class {
568568

569569
this._isShrunk = false; // whether canvas is collapsed
570570

571-
/**
572-
* @todo write comments to describe each variable
573-
*/
574-
this._expandedBoundary = null;
575-
this._collapsedBoundary = null;
576-
this._expandButton = null; // used by add method
577-
this._collapseButton = null; // used by add method
578-
this._clearButton = null; // used by add method
579-
this.gridButton = null; // used by add method
580-
this.collapse = null;
581-
this.expand = null;
571+
this._expandedBoundary = null; // The boundary when the canvas is expanded
572+
this._collapsedBoundary = null; // The boundry when the canvas is collapsed
573+
this._expandButton = null; // Button to expand the canvas
574+
this._collapseButton = null; // Button to collapse the canvas
575+
this._clearButton = null; // Button to clear the canvas
576+
this.gridButton = null; // Button to select the grid style
577+
this.collapse = null; // Function to collapse the canvas
578+
this.expand = null; // Function to expand the canvas
582579

583580
// canvas background color
584581
this._backgroundColor = platformColor.background;
585582

586-
this._locked = false;
583+
this._locked = false; // whether the canvas is locked
587584
this._queue = []; // temporarily stores [w, h, scale]
588585

589-
this.currentGrid = null;
586+
this.currentGrid = null; // currently selected grid
590587

591588
// Attach an event listener to the 'resize' event
592589
window.addEventListener("resize", () => {

0 commit comments

Comments
 (0)