
# Set up the test environment, if it does not already exist. Delete any
# canvas3d items that may be left over from a previous test script.
if {[info commands .win] == ""} {
    source [file join [file dirname [info script]] interactive.tcl]
}

i_test layers-1.1 {
There should be a yellow rectangle with a blue rectangle in front of it.
} {
.win delete all
.win configure -width 600 -height 400

.win create 2dpolygon {50 50 250 50 250 150 50 150} -color yellow
.win create 2dpolygon {150 100 350 100 350 350 150 350} -color blue -tags blue
}

i_test layers-1.2 {
The blue rectangle should be under the yellow.
} {
  .win itemconfigure blue -layer 0.5
}

i_test layers-1.3 {
The blue rectangle should be on top of the yellow.
} {
  .win itemconfigure !blue -layer 0.2
}

i_test layers-1.1 {
There should be a yellow rectangle with white text on top of it.
} {
.win delete all
.win create 2dpolygon {50 50 550 50 550 350 50 350} -color yellow
.win create 2dtext {300 150} -text "Hello World" -anchor center -font {-size 30}
}

i_test layers-1.2 {
The text should disappear (it's behind the rectangle)
} {
.win itemconfigure type(2dtext) -layer 0.5
}
