Added init keyword to testdata

This commit is contained in:
Stanislav Erokhin
2015-04-01 05:21:26 +03:00
parent 6ab83c9b8c
commit b152211096
88 changed files with 114 additions and 114 deletions
@@ -210,7 +210,7 @@ class CanvasState(val canvas: HTMLCanvasElement) {
var dragOff = Vector()
val interval = 1000 / 30
{
init {
jq(canvas).mousedown {
valid = false
selection = null
@@ -295,7 +295,7 @@ class RadialGradientGenerator(val context: CanvasContext) {
gradients.add(colorStops)
}
{
init {
newColorStops(Pair(0.0, "#F59898"), Pair(0.5, "#F57373"), Pair(1.0, "#DB6B6B"))
newColorStops(Pair(0.39, "rgb(140,167,209)"), Pair(0.7, "rgb(104,139,209)"), Pair(0.85, "rgb(67,122,217)"))
newColorStops(Pair(0.0, "rgb(255,222,255)"), Pair(0.5, "rgb(255,185,222)"), Pair(1.0, "rgb(230,154,185)"))
@@ -45,7 +45,7 @@ class HelloKotlin() {
val message = "Hello, Kotlin!"
val textHeightInPixels = 20
{
init {
context.font = "bold ${textHeightInPixels}px Georgia, serif"
}
val textWidthInPixels = context.measureText(message)!!.width
@@ -177,7 +177,7 @@ class TrafficLight(override var pos: Vector, val direction: String, val startCol
var isForceColorChange = false
var changeColorForward = (startColor == "red")
{
init {
list.add(TrafficLightItem(v(pos.x, pos.y), PATH_TO_IMAGES + "red_color.png"))
list.add(TrafficLightItem(v(pos.x, pos.y), PATH_TO_IMAGES + "yellow_color.png"))
list.add(TrafficLightItem(v(pos.x, pos.y), PATH_TO_IMAGES + "green_color.png"))
@@ -378,7 +378,7 @@ class CanvasState(val canvas: HTMLCanvasElement) {
shapes.add(shape)
}
{
init {
jq(canvas).click {
val mousePos = mousePos(it)
@shapeLoop for (shape in shapes) {