Nincs leírás

miket 814008ac88 Добавить 'README.md' 1 hónapja
src a6496b1da7 ad 1 hónapja
README.md 814008ac88 Добавить 'README.md' 1 hónapja
exts.iml a6496b1da7 ad 1 hónapja

README.md

На пример кода, будет слежующий вывод

    override fun area(): Float {
        return width * height
    }

    override fun resize(zoom: Int) {
        width*=zoom
        height*=zoom
    }

    override fun rotate(direction: RotateDirection, centerX: Int, centerY: Int) {
        var tmpX = x - centerX
        var tmpY = y - centerY
        if (direction == RotateDirection.CounterClockwise){
            val buf = -tmpY
            tmpY = tmpX
            tmpX = buf
        }else{
            val buf = tmpY
            tmpY = - tmpX
            tmpX = buf
        }

        x = tmpX + centerX;
        y = tmpY + centerY;
    }
Rect area:1.0 x:0 y:0 width:1 height:1
Rect after resize 100.0 x:0 y:0 width:10 height:10
Circle area:12.56 x:1.0 y:2.0 r:2.0
Circle after resize area:1256.0 x:1.0 y:2.0 r:20.0
Circle after rotation area:1256.0 x:2.0 y:1.0 r:20.0
1256.0