public override bool shouldRepaint(CustomPainter _oldDelegate)
        {
            _GlowingOverscrollIndicatorPainter oldDelegate = _oldDelegate as _GlowingOverscrollIndicatorPainter;

            return(oldDelegate.leadingController != leadingController ||
                   oldDelegate.trailingController != trailingController);
        }
Ejemplo n.º 2
0
 private void Awake()
 {
     gameState             = GameState.START_UI;
     uiController          = GetComponent <UIController>();
     cameraController      = FindObjectOfType <CameraController>();
     customPainter         = FindObjectOfType <CustomPainter>();
     customPainter.enabled = false;
 }
Ejemplo n.º 3
0
 public override bool shouldRepaint(CustomPainter oldDelegate)
 {
     if (oldDelegate is LottiePainter oldLottiePainter)
     {
         return(_frame != oldLottiePainter._frame);
     }
     return(true);
 }
Ejemplo n.º 4
0
        public override bool shouldRepaint(CustomPainter _oldDelegate)
        {
            BannerPainter oldDelegate = _oldDelegate as BannerPainter;

            return(this.message != oldDelegate.message ||
                   this.location != oldDelegate.location ||
                   this.color != oldDelegate.color ||
                   this.textStyle != oldDelegate.textStyle);
        }
Ejemplo n.º 5
0
        public override void Draw(NGraphics.ICanvas canvas, NGraphics.Rect rect)
        {
            if (BackgroundColor == Xamarin.Forms.Color.Transparent && BorderColor == Xamarin.Forms.Color.Transparent)
            {
                return;
            }

            CustomPainter.Paint(this, canvas, rect);
        }
Ejemplo n.º 6
0
        public override bool shouldRepaint(CustomPainter painter)
        {
            _DropdownMenuPainter oldPainter = painter as _DropdownMenuPainter;

            return(oldPainter.color != color ||
                   oldPainter.elevation != elevation ||
                   oldPainter.selectedIndex != selectedIndex ||
                   oldPainter.resize != resize);
        }
Ejemplo n.º 7
0
        public override bool shouldRepaint(CustomPainter oldPainter)
        {
            D.assert(oldPainter is _LinearProgressIndicatorPainter);
            _LinearProgressIndicatorPainter painter = oldPainter as _LinearProgressIndicatorPainter;

            return(painter.backgroundColor != this.backgroundColor ||
                   painter.valueColor != this.valueColor ||
                   painter.value != this.value ||
                   painter.animationValue != this.animationValue);
        }
Ejemplo n.º 8
0
        public override bool shouldRepaint(CustomPainter _oldDelegate)
        {
            _AnimatedIconPainter oldDelegate = _oldDelegate as _AnimatedIconPainter;

            return(oldDelegate.progress.value != progress.value ||
                   oldDelegate.color != color ||
                   oldDelegate.paths != paths ||
                   oldDelegate.scale != scale ||
                   oldDelegate.uiPathFactory != uiPathFactory);
        }
Ejemplo n.º 9
0
        public override bool shouldRepaint(CustomPainter old)
        {
            _IndicatorPainter _old = (_IndicatorPainter)old;

            return(this._needsPaint ||
                   this.controller != _old.controller ||
                   this.indicator != _old.indicator ||
                   this.tabKeys.Count != _old.tabKeys.Count ||
                   !_tabOffsetsEqual(this._currentTabOffsets, _old._currentTabOffsets));
        }
Ejemplo n.º 10
0
        public override bool shouldRepaint(CustomPainter oldPainter)
        {
            D.assert(oldPainter is _CircularProgressIndicatorPainter);
            _CircularProgressIndicatorPainter painter = oldPainter as _CircularProgressIndicatorPainter;

            return(painter.valueColor != this.valueColor ||
                   painter.value != this.value ||
                   painter.headValue != this.headValue ||
                   painter.tailValue != this.tailValue ||
                   painter.stepValue != this.stepValue ||
                   painter.rotationValue != this.rotationValue ||
                   painter.strokeWidth != this.strokeWidth);
        }
        public override bool shouldRepaint(CustomPainter oldDelegate)
        {
            return(true);

            NodePortConnectionCustomPainter oldPainter = oldDelegate as NodePortConnectionCustomPainter;

            if (oldPainter == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 12
0
        public bool shouldRepaint(CustomPainter oldRaw)
        {
            if (oldRaw is ScrollbarPainter old)
            {
                return(this.color != old.color ||
                       this.textDirection != old.textDirection ||
                       this.thickness != old.thickness ||
                       this.fadeoutOpacityAnimation != old.fadeoutOpacityAnimation ||
                       this.mainAxisMargin != old.mainAxisMargin ||
                       this.crossAxisMargin != old.crossAxisMargin ||
                       this.radius != old.radius ||
                       this.minLength != old.minLength);
            }

            return(false);
        }
Ejemplo n.º 13
0
 public RenderCustomPaint(
     CustomPainter painter           = null,
     CustomPainter foregroundPainter = null,
     Size preferredSize = null,
     bool isComplex     = false,
     bool willChange    = false,
     RenderBox child    = null
     ) : base(child)
 {
     preferredSize      = preferredSize ?? Size.zero;
     this.preferredSize = preferredSize;
     _painter           = painter;
     _foregroundPainter = foregroundPainter;
     this.isComplex     = isComplex;
     this.willChange    = willChange;
 }
Ejemplo n.º 14
0
        void _paintWithPainter(Canvas canvas, Offset offset, CustomPainter painter)
        {
            int debugPreviousCanvasSaveCount = 0;

            canvas.save();
            D.assert(() => {
                debugPreviousCanvasSaveCount = canvas.getSaveCount();
                return(true);
            });
            if (offset != Offset.zero)
            {
                canvas.translate(offset.dx, offset.dy);
            }

            painter.paint(canvas, size);
            D.assert(() => {
                int debugNewCanvasSaveCount = canvas.getSaveCount();
                if (debugNewCanvasSaveCount > debugPreviousCanvasSaveCount)
                {
                    throw new UIWidgetsError(new List <DiagnosticsNode> {
                        new ErrorSummary(
                            $"The {painter} custom painter called canvas.save() or canvas.saveLayer() at least " +
                            $"{debugNewCanvasSaveCount - debugPreviousCanvasSaveCount} more " +
                            "times than it called canvas.restore()."
                            ),
                        new ErrorDescription("This leaves the canvas in an inconsistent state and will probably result in a broken display."),
                        new ErrorHint("You must pair each call to save()/saveLayer() with a later matching call to restore().")
                    });
                }

                if (debugNewCanvasSaveCount < debugPreviousCanvasSaveCount)
                {
                    throw new UIWidgetsError(new List <DiagnosticsNode> {
                        new ErrorSummary(
                            $"The {painter} custom painter called canvas.restore() " +
                            $"{debugPreviousCanvasSaveCount - debugNewCanvasSaveCount} more " +
                            "times than it called canvas.save() or canvas.saveLayer()."
                            ),
                        new ErrorDescription("This leaves the canvas in an inconsistent state and will result in a broken display."),
                        new ErrorHint("You should only call restore() if you first called save() or saveLayer().")
                    });
                }

                return(debugNewCanvasSaveCount == debugPreviousCanvasSaveCount);
            });
            canvas.restore();
        }
Ejemplo n.º 15
0
        void _paintWithPainter(Canvas canvas, Offset offset, CustomPainter painter)
        {
            int debugPreviousCanvasSaveCount = 0;

            canvas.save();
            D.assert(() => {
                debugPreviousCanvasSaveCount = canvas.getSaveCount();
                return(true);
            });
            if (offset != Offset.zero)
            {
                canvas.translate(offset.dx, offset.dy);
            }

            painter.paint(canvas, this.size);
            D.assert(() => {
                int debugNewCanvasSaveCount = canvas.getSaveCount();
                if (debugNewCanvasSaveCount > debugPreviousCanvasSaveCount)
                {
                    throw new UIWidgetsError(
                        $"{debugNewCanvasSaveCount - debugPreviousCanvasSaveCount} more " +
                        $"time{((debugNewCanvasSaveCount - debugPreviousCanvasSaveCount == 1) ? "" : "s")} " +
                        "than it called canvas.restore().\n" +
                        "This leaves the canvas in an inconsistent state and will probably result in a broken display.\n" +
                        "You must pair each call to save()/saveLayer() with a later matching call to restore()."
                        );
                }

                if (debugNewCanvasSaveCount < debugPreviousCanvasSaveCount)
                {
                    throw new UIWidgetsError(
                        $"The {painter} custom painter called canvas.restore() " +
                        $"{debugPreviousCanvasSaveCount - debugNewCanvasSaveCount} more " +
                        $"time{(debugPreviousCanvasSaveCount - debugNewCanvasSaveCount == 1 ? "" : "s")} " +
                        "than it called canvas.save() or canvas.saveLayer().\n" +
                        "This leaves the canvas in an inconsistent state and will result in a broken display.\n" +
                        "You should only call restore() if you first called save() or saveLayer()."
                        );
                }

                return(debugNewCanvasSaveCount == debugPreviousCanvasSaveCount);
            });
            canvas.restore();
        }
Ejemplo n.º 16
0
        void _didUpdatePainter(CustomPainter newPainter, CustomPainter oldPainter)
        {
            if (newPainter == null)
            {
                D.assert(oldPainter != null);
                markNeedsPaint();
            }
            else if (oldPainter == null ||
                     newPainter.GetType() != oldPainter.GetType() ||
                     newPainter.shouldRepaint(oldPainter))
            {
                markNeedsPaint();
            }

            if (attached)
            {
                oldPainter?.removeListener(markNeedsPaint);
                newPainter?.addListener(markNeedsPaint);
            }
        }
        public override bool shouldRepaint(CustomPainter _oldPainter)
        {
            _RadialPainter oldPainter = _oldPainter as _RadialPainter;

            if (this.circles == oldPainter.circles)
            {
                return(false);
            }

            if (this.circles.Count != oldPainter.circles.Count)
            {
                return(true);
            }

            for (int i = 0; i < this.circles.Count; i += 1)
            {
                if (this.circles[i] != oldPainter.circles[i])
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 18
0
 public override bool shouldRepaint(CustomPainter oldPainter)
 {
     return(((oldPainter as _CupertinoActivityIndicatorPainter).position != position) ||
            ((oldPainter as _CupertinoActivityIndicatorPainter).activeColor != activeColor));
 }
Ejemplo n.º 19
0
 public override bool shouldRepaint(CustomPainter oldPainter)
 {
     return(((_Placeholderpainter)oldPainter).color != color ||
            ((_Placeholderpainter)oldPainter).strokeWidth != strokeWidth);
 }
Ejemplo n.º 20
0
        public bool shouldRepaint(CustomPainter oldDelegate)
        {
            var oldPainter = oldDelegate as _MaterialPainter;

            return(oldPainter.mOffset != mOffset || oldPainter.mSize != mSize);
        }
Ejemplo n.º 21
0
        public override bool shouldRepaint(CustomPainter oldDelegate)
        {
            _ShapeBorderPainter _oldDelegate = (_ShapeBorderPainter)oldDelegate;

            return(_oldDelegate.border != this.border);
        }
Ejemplo n.º 22
0
 public override bool shouldRepaint(CustomPainter oldPainter)
 {
     return(color != ((_TextSelectionHandlePainter)oldPainter).color);
 }
Ejemplo n.º 23
0
 public bool shouldRepaint(CustomPainter oldDelegate)
 {
     return(true);
 }
Ejemplo n.º 24
0
 public override bool shouldRepaint(CustomPainter oldPainter) => false;
Ejemplo n.º 25
0
 public override bool shouldRepaint(CustomPainter oldPainter)
 {
     return(this.origin != ((_TextSelectionHandlePainter)oldPainter).origin);
 }
Ejemplo n.º 26
0
 public abstract bool shouldRepaint(CustomPainter oldDelegate);
Ejemplo n.º 27
0
 public bool shouldRepaint(CustomPainter oldDelegate)
 {
     return(oldDelegate != this);
 }
Ejemplo n.º 28
0
    public override bool shouldRepaint(CustomPainter oldDelegate)
    {
        ColorPainter colP = oldDelegate as ColorPainter;

        return(colP != null ? colP.info != info : false);
    }
Ejemplo n.º 29
0
 public override bool shouldRepaint(CustomPainter oldPainter)
 {
     return(false);
 }
Ejemplo n.º 30
0
 public override bool shouldRepaint(CustomPainter oldPainter)
 {
     return(((_TrianglePainter)oldPainter).color != color);
 }