EntityView.smali

.class public Lim/tpelyyftgw/ui/components/paint/views/EntityView;
.super Landroid/widget/FrameLayout;
.source "EntityView.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;,
        Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;
    }
.end annotation


# instance fields
.field private announcedSelection:Z

.field private delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

.field private gestureDetector:Landroid/view/GestureDetector;

.field private hasPanned:Z

.field private hasReleased:Z

.field private hasTransformed:Z

.field private offsetX:I

.field private offsetY:I

.field protected position:Lim/tpelyyftgw/ui/components/Point;

.field private previousLocationX:F

.field private previousLocationY:F

.field private recognizedLongPress:Z

.field protected selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

.field private uuid:Ljava/util/UUID;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lim/tpelyyftgw/ui/components/Point;)V
    .registers 5
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "pos"    # Lim/tpelyyftgw/ui/components/Point;

    .line 47
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 28
    const/4 v0, 0x0

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasPanned:Z

    .line 29
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasReleased:Z

    .line 30
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasTransformed:Z

    .line 31
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->announcedSelection:Z

    .line 32
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->recognizedLongPress:Z

    .line 36
    new-instance v0, Lim/tpelyyftgw/ui/components/Point;

    invoke-direct {v0}, Lim/tpelyyftgw/ui/components/Point;-><init>()V

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    .line 49
    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->uuid:Ljava/util/UUID;

    .line 50
    iput-object p2, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    .line 52
    new-instance v0, Landroid/view/GestureDetector;

    new-instance v1, Lim/tpelyyftgw/ui/components/paint/views/EntityView$1;

    invoke-direct {v1, p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$1;-><init>(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)V

    invoke-direct {v0, p1, v1}, Landroid/view/GestureDetector;-><init>(Landroid/content/Context;Landroid/view/GestureDetector$OnGestureListener;)V

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->gestureDetector:Landroid/view/GestureDetector;

    .line 65
    return-void
.end method

.method static synthetic access$000(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasPanned:Z

    return v0
.end method

.method static synthetic access$100(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasTransformed:Z

    return v0
.end method

.method static synthetic access$1000(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)V
    .registers 1
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->onTouchUp()V

    return-void
.end method

.method static synthetic access$102(Lim/tpelyyftgw/ui/components/paint/views/EntityView;Z)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;
    .param p1, "x1"    # Z

    .line 18
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasTransformed:Z

    return p1
.end method

.method static synthetic access$1100(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Landroid/view/GestureDetector;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->gestureDetector:Landroid/view/GestureDetector;

    return-object v0
.end method

.method static synthetic access$200(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasReleased:Z

    return v0
.end method

.method static synthetic access$202(Lim/tpelyyftgw/ui/components/paint/views/EntityView;Z)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;
    .param p1, "x1"    # Z

    .line 18
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasReleased:Z

    return p1
.end method

.method static synthetic access$302(Lim/tpelyyftgw/ui/components/paint/views/EntityView;Z)Z
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;
    .param p1, "x1"    # Z

    .line 18
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->recognizedLongPress:Z

    return p1
.end method

.method static synthetic access$400(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    return-object v0
.end method

.method static synthetic access$500(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)I
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->offsetX:I

    return v0
.end method

.method static synthetic access$600(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)I
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->offsetY:I

    return v0
.end method

.method static synthetic access$700(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)F
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationX:F

    return v0
.end method

.method static synthetic access$702(Lim/tpelyyftgw/ui/components/paint/views/EntityView;F)F
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;
    .param p1, "x1"    # F

    .line 18
    iput p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationX:F

    return p1
.end method

.method static synthetic access$800(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)F
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;

    .line 18
    iget v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationY:F

    return v0
.end method

.method static synthetic access$802(Lim/tpelyyftgw/ui/components/paint/views/EntityView;F)F
    .registers 2
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;
    .param p1, "x1"    # F

    .line 18
    iput p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationY:F

    return p1
.end method

.method static synthetic access$900(Lim/tpelyyftgw/ui/components/paint/views/EntityView;FF)Z
    .registers 4
    .param p0, "x0"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView;
    .param p1, "x1"    # F
    .param p2, "x2"    # F

    .line 18
    invoke-direct {p0, p1, p2}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->onTouchMove(FF)Z

    move-result v0

    return v0
.end method

.method private onTouchMove(FF)Z
    .registers 9
    .param p1, "x"    # F
    .param p2, "y"    # F

    .line 104
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getScaleX()F

    move-result v0

    .line 105
    .local v0, "scale":F
    new-instance v1, Lim/tpelyyftgw/ui/components/Point;

    iget v2, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationX:F

    sub-float v2, p1, v2

    div-float/2addr v2, v0

    iget v3, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationY:F

    sub-float v3, p2, v3

    div-float/2addr v3, v0

    invoke-direct {v1, v2, v3}, Lim/tpelyyftgw/ui/components/Point;-><init>(FF)V

    .line 106
    .local v1, "translation":Lim/tpelyyftgw/ui/components/Point;
    iget v2, v1, Lim/tpelyyftgw/ui/components/Point;->x:F

    float-to-double v2, v2

    iget v4, v1, Lim/tpelyyftgw/ui/components/Point;->y:F

    float-to-double v4, v4

    invoke-static {v2, v3, v4, v5}, Ljava/lang/Math;->hypot(DD)D

    move-result-wide v2

    double-to-float v2, v2

    .line 107
    .local v2, "distance":F
    iget-boolean v3, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasPanned:Z

    if-eqz v3, :cond_2b

    const/high16 v3, 0x40c00000    # 6.0f

    goto :goto_2d

    :cond_2b
    const/high16 v3, 0x41800000    # 16.0f

    .line 108
    .local v3, "minDistance":F
    :goto_2d
    cmpl-float v4, v2, v3

    if-lez v4, :cond_3c

    .line 109
    invoke-virtual {p0, v1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->pan(Lim/tpelyyftgw/ui/components/Point;)V

    .line 110
    iput p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationX:F

    .line 111
    iput p2, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationY:F

    .line 112
    const/4 v4, 0x1

    iput-boolean v4, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasPanned:Z

    .line 113
    return v4

    .line 115
    :cond_3c
    const/4 v4, 0x0

    return v4
.end method

.method private onTouchUp()V
    .registers 3

    .line 119
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->recognizedLongPress:Z

    if-nez v0, :cond_17

    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasPanned:Z

    if-nez v0, :cond_17

    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasTransformed:Z

    if-nez v0, :cond_17

    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->announcedSelection:Z

    if-nez v0, :cond_17

    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    if-eqz v0, :cond_17

    .line 120
    invoke-interface {v0, p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;->onEntitySelected(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z

    .line 122
    :cond_17
    const/4 v0, 0x0

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->recognizedLongPress:Z

    .line 123
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasPanned:Z

    .line 124
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasTransformed:Z

    .line 125
    const/4 v1, 0x1

    iput-boolean v1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasReleased:Z

    .line 126
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->announcedSelection:Z

    .line 127
    return-void
.end method


# virtual methods
.method protected createSelectionView()Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;
    .registers 2

    .line 208
    const/4 v0, 0x0

    return-object v0
.end method

.method public deselect()V
    .registers 3

    .line 225
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    if-nez v0, :cond_5

    .line 226
    return-void

    .line 228
    :cond_5
    invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    if-eqz v0, :cond_18

    .line 229
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;

    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 231
    :cond_18
    const/4 v0, 0x0

    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    .line 232
    return-void
.end method

.method public getPosition()Lim/tpelyyftgw/ui/components/Point;
    .registers 2

    .line 72
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    return-object v0
.end method

.method public getScale()F
    .registers 2

    .line 81
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->getScaleX()F

    move-result v0

    return v0
.end method

.method protected getSelectionBounds()Lim/tpelyyftgw/ui/components/Rect;
    .registers 3

    .line 200
    new-instance v0, Lim/tpelyyftgw/ui/components/Rect;

    const/4 v1, 0x0

    invoke-direct {v0, v1, v1, v1, v1}, Lim/tpelyyftgw/ui/components/Rect;-><init>(FFFF)V

    return-object v0
.end method

.method public getUUID()Ljava/util/UUID;
    .registers 2

    .line 68
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->uuid:Ljava/util/UUID;

    return-object v0
.end method

.method public isSelected()Z
    .registers 2

    .line 204
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    if-eqz v0, :cond_6

    const/4 v0, 0x1

    goto :goto_7

    :cond_6
    const/4 v0, 0x0

    :goto_7
    return v0
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 3
    .param p1, "ev"    # Landroid/view/MotionEvent;

    .line 100
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    invoke-interface {v0, p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;->allowInteraction(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z

    move-result v0

    return v0
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 9
    .param p1, "event"    # Landroid/view/MotionEvent;

    .line 131
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I

    move-result v0

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-gt v0, v2, :cond_56

    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    invoke-interface {v0, p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;->allowInteraction(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z

    move-result v0

    if-nez v0, :cond_11

    goto :goto_56

    .line 135
    :cond_11
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F

    move-result v0

    .line 136
    .local v0, "x":F
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F

    move-result v3

    .line 137
    .local v3, "y":F
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I

    move-result v4

    .line 138
    .local v4, "action":I
    const/4 v5, 0x0

    .line 140
    .local v5, "handled":Z
    if-eqz v4, :cond_39

    if-eq v4, v2, :cond_34

    const/4 v6, 0x2

    if-eq v4, v6, :cond_2f

    const/4 v6, 0x3

    if-eq v4, v6, :cond_34

    const/4 v6, 0x5

    if-eq v4, v6, :cond_39

    const/4 v1, 0x6

    if-eq v4, v1, :cond_34

    goto :goto_50

    .line 155
    :cond_2f
    invoke-direct {p0, v0, v3}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->onTouchMove(FF)Z

    move-result v5

    .line 157
    goto :goto_50

    .line 162
    :cond_34
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->onTouchUp()V

    .line 163
    const/4 v5, 0x1

    goto :goto_50

    .line 143
    :cond_39
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->isSelected()Z

    move-result v6

    if-nez v6, :cond_48

    iget-object v6, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    if-eqz v6, :cond_48

    .line 144
    invoke-interface {v6, p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;->onEntitySelected(Lim/tpelyyftgw/ui/components/paint/views/EntityView;)Z

    .line 145
    iput-boolean v2, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->announcedSelection:Z

    .line 147
    :cond_48
    iput v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationX:F

    .line 148
    iput v3, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->previousLocationY:F

    .line 149
    const/4 v5, 0x1

    .line 150
    iput-boolean v1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->hasReleased:Z

    .line 152
    nop

    .line 168
    :goto_50
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->gestureDetector:Landroid/view/GestureDetector;

    invoke-virtual {v1, p1}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z

    .line 170
    return v5

    .line 132
    .end local v0    # "x":F
    .end local v3    # "y":F
    .end local v4    # "action":I
    .end local v5    # "handled":Z
    :cond_56
    :goto_56
    return v1
.end method

.method public pan(Lim/tpelyyftgw/ui/components/Point;)V
    .registers 5
    .param p1, "translation"    # Lim/tpelyyftgw/ui/components/Point;

    .line 174
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    iget v1, v0, Lim/tpelyyftgw/ui/components/Point;->x:F

    iget v2, p1, Lim/tpelyyftgw/ui/components/Point;->x:F

    add-float/2addr v1, v2

    iput v1, v0, Lim/tpelyyftgw/ui/components/Point;->x:F

    .line 175
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    iget v1, v0, Lim/tpelyyftgw/ui/components/Point;->y:F

    iget v2, p1, Lim/tpelyyftgw/ui/components/Point;->y:F

    add-float/2addr v1, v2

    iput v1, v0, Lim/tpelyyftgw/ui/components/Point;->y:F

    .line 176
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->updatePosition()V

    .line 177
    return-void
.end method

.method public rotate(F)V
    .registers 2
    .param p1, "angle"    # F

    .line 195
    invoke-virtual {p0, p1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->setRotation(F)V

    .line 196
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->updateSelectionView()V

    .line 197
    return-void
.end method

.method public scale(F)V
    .registers 4
    .param p1, "scale"    # F

    .line 189
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->getScale()F

    move-result v0

    mul-float v0, v0, p1

    const v1, 0x3dcccccd    # 0.1f

    invoke-static {v0, v1}, Ljava/lang/Math;->max(FF)F

    move-result v0

    .line 190
    .local v0, "newScale":F
    invoke-virtual {p0, v0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->setScale(F)V

    .line 191
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->updateSelectionView()V

    .line 192
    return-void
.end method

.method public select(Landroid/view/ViewGroup;)V
    .registers 3
    .param p1, "selectionContainer"    # Landroid/view/ViewGroup;

    .line 218
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->createSelectionView()Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    move-result-object v0

    .line 219
    .local v0, "selectionView":Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;
    iput-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    .line 220
    invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    .line 221
    invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;->updatePosition()V

    .line 222
    return-void
.end method

.method public setDelegate(Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;)V
    .registers 2
    .param p1, "entityViewDelegate"    # Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    .line 90
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->delegate:Lim/tpelyyftgw/ui/components/paint/views/EntityView$EntityViewDelegate;

    .line 91
    return-void
.end method

.method public setOffset(II)V
    .registers 3
    .param p1, "x"    # I
    .param p2, "y"    # I

    .line 94
    iput p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->offsetX:I

    .line 95
    iput p2, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->offsetY:I

    .line 96
    return-void
.end method

.method public setPosition(Lim/tpelyyftgw/ui/components/Point;)V
    .registers 2
    .param p1, "value"    # Lim/tpelyyftgw/ui/components/Point;

    .line 76
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    .line 77
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->updatePosition()V

    .line 78
    return-void
.end method

.method public setScale(F)V
    .registers 2
    .param p1, "scale"    # F

    .line 85
    invoke-virtual {p0, p1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->setScaleX(F)V

    .line 86
    invoke-virtual {p0, p1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->setScaleY(F)V

    .line 87
    return-void
.end method

.method public setSelectionVisibility(Z)V
    .registers 4
    .param p1, "visible"    # Z

    .line 235
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    if-nez v0, :cond_5

    .line 236
    return-void

    .line 238
    :cond_5
    if-eqz p1, :cond_9

    const/4 v1, 0x0

    goto :goto_b

    :cond_9
    const/16 v1, 0x8

    :goto_b
    invoke-virtual {v0, v1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;->setVisibility(I)V

    .line 239
    return-void
.end method

.method protected updatePosition()V
    .registers 4

    .line 180
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->getWidth()I

    move-result v0

    int-to-float v0, v0

    const/high16 v1, 0x40000000    # 2.0f

    div-float/2addr v0, v1

    .line 181
    .local v0, "halfWidth":F
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->getHeight()I

    move-result v2

    int-to-float v2, v2

    div-float/2addr v2, v1

    .line 182
    .local v2, "halfHeight":F
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    iget v1, v1, Lim/tpelyyftgw/ui/components/Point;->x:F

    sub-float/2addr v1, v0

    invoke-virtual {p0, v1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->setX(F)V

    .line 183
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->position:Lim/tpelyyftgw/ui/components/Point;

    iget v1, v1, Lim/tpelyyftgw/ui/components/Point;->y:F

    sub-float/2addr v1, v2

    invoke-virtual {p0, v1}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->setY(F)V

    .line 184
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->updateSelectionView()V

    .line 185
    return-void
.end method

.method public updateSelectionView()V
    .registers 2

    .line 212
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/paint/views/EntityView;->selectionView:Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;

    if-eqz v0, :cond_7

    .line 213
    invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/paint/views/EntityView$SelectionView;->updatePosition()V

    .line 215
    :cond_7
    return-void
.end method