PG1204 commented on code in PR #6927:
URL: https://github.com/apache/texera/pull/6927#discussion_r3731039549


##########
frontend/src/app/workspace/service/joint-ui/joint-ui.service.ts:
##########
@@ -491,11 +491,24 @@ export class JointUIService {
    * @param isOperatorValid
    */
   public changeOperatorColor(jointPaper: joint.dia.Paper, operatorID: string, 
isOperatorValid: boolean): void {
-    if (isOperatorValid) {
-      jointPaper.getModelById(operatorID).attr("rect.body/stroke", "#CFCFCF");
-    } else {
-      jointPaper.getModelById(operatorID).attr("rect.body/stroke", "red");
+    this.paintOperatorBorder(jointPaper, operatorID, isOperatorValid ? 
"#CFCFCF" : "red");
+  }
+
+  /**
+   * Sets the operator's border stroke, returning early when it is already that
+   * color. A same-value attr() write would not re-render (Backbone's Model.set
+   * no-ops via _.isEqual), but attr() still deep-clones and deep-compares the
+   * whole attrs tree before reaching that check (~46us on our elements, down 
to

Review Comment:
   done, comment modified - numbers were dropped and mechanism was kept.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to