diff --git a/.idea/misc.xml b/.idea/misc.xml index 37a7509..7bfef59 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/visualizer/src/main/java/io/github/jeffshee/visualizer/painters/modifier/Rotate.kt b/visualizer/src/main/java/io/github/jeffshee/visualizer/painters/modifier/Rotate.kt index 3f826f3..8b1cb75 100644 --- a/visualizer/src/main/java/io/github/jeffshee/visualizer/painters/modifier/Rotate.kt +++ b/visualizer/src/main/java/io/github/jeffshee/visualizer/painters/modifier/Rotate.kt @@ -9,22 +9,24 @@ class Rotate : Painter { var xR: Float var yR: Float var rpm: Float + var offset: Float - constructor(painters: List, xR: Float = .5f, yR: Float = .5f, rpm: Float = 1f) { + constructor(painters: List, xR: Float = .5f, yR: Float = .5f, rpm: Float = 1f, offset: Float = 0f) { this.painters = painters this.xR = xR this.yR = yR this.rpm = rpm + this.offset = offset } - constructor(painter: Painter, xR: Float = .5f, yR: Float = .5f, rpm: Float = 1f) : this( - listOf(painter), xR, yR, rpm + constructor(painter: Painter, xR: Float = .5f, yR: Float = .5f, rpm: Float = 1f, offset: Float = 0f) : this( + listOf(painter), xR, yR, rpm, offset ) private var rot: Float = 0f override fun draw(canvas: Canvas, helper: VisualizerHelper) { - rotateHelper(canvas, rot, xR, yR) { + rotateHelper(canvas, rot + offset, xR, yR) { painters.forEach { painter -> painter.draw(canvas, helper) }