Update tests expected files

This commit is contained in:
Sergey Mashkov
2016-10-18 16:14:45 +03:00
parent ecbf2c023d
commit d3afb683a3
2 changed files with 9 additions and 7 deletions
@@ -306,14 +306,15 @@ class RadialGradientGenerator(val context: CanvasRenderingContext2D) {
}
}
fun v(x: Int, y: Int) = Vector(x, y)
fun v(x: Double, y: Double) = Vector(x.toInt(), y.toInt())
fun v(x: Double, y: Double) = Vector(x, y)
fun v(x: Int, y: Int) = Vector(x.toDouble(), y.toDouble())
class Vector(val x: Double = 0.0, val y: Double = 0.0) {
constructor(x: Int, y: Int) : this(x.toDouble(), y.toDouble())
class Vector(val x: Int = 0.0, val y: Int = 0.0) {
operator fun plus(v: Vector) = v(x + v.x, y + v.y)
operator fun unaryMinus() = v(-x, -y)
operator fun minus(v: Vector) = v(x - v.x, y - v.y)
operator fun times(koef: Int) = v(x * koef, y * koef)
operator fun times(koef: Double) = v(x * koef, y * koef)
infix fun distanceTo(v: Vector) = Math.sqrt((this - v).sqr)
fun rotatedBy(theta: Double): Vector {
@@ -61,7 +61,7 @@ fun main(args: Array<String>) {
state.addShape(Button(PATH_TO_IMAGES + "ud.png", v(455.0, 120.0), v(50.0, 120.0)))
}
fun v(x: Double, y: Double) = Vector(x.toInt(), y.toInt())
fun v(x: Double, y: Double) = Vector(x, y)
fun v(x: Int, y: Int) = Vector(x, y)
class Image(val src: String, override var pos: Vector, var imageSize: Vector) : Shape() {
@@ -482,8 +482,9 @@ abstract class Shape() {
}
class Vector(val x: Int = 0, val y: Int = 0) {
constructor(x: Double, y: Double) : this(x.toInt(), y.toInt())
class Vector(val x: Double = 0.0, val y: Double = 0.0) {
constructor(x: Int, y: Int) : this(x.toDouble(), y.toDouble())
operator fun plus(v: Vector) = v(x + v.x, y + v.y)
operator fun unaryMinus() = v(-x, -y)
operator fun minus(v: Vector) = v(x - v.x, y - v.y)