Преглед на файлове

Fix comment clip control for GUI

David Catuhe преди 6 години
родител
ревизия
3e8a69da21
променени са 1 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. 9 3
      gui/src/2D/controls/control.ts

+ 9 - 3
gui/src/2D/controls/control.ts

@@ -128,6 +128,12 @@ export class Control {
     public clipChildren = true;
 
     /**
+     * Gets or sets a boolean indicating that control content must be clipped
+     * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
+     */
+    public clipContent = true;
+
+    /**
      * Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)
      */
     public useBitmapCache = false;
@@ -1589,9 +1595,9 @@ export class Control {
         this._transform(context);
 
         // Clip
-        //     if (this.clipChildren) {
-        this._clip(context, invalidatedRectangle);
-        //   }
+        if (this.clipContent) {
+            this._clip(context, invalidatedRectangle);
+        }
 
         if (this.onBeforeDrawObservable.hasObservers()) {
             this.onBeforeDrawObservable.notifyObservers(this);