
# 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 overlay-1.1 {
There should be diagonal lines between oppisite corners of the viewport.
} {
.win delete all
.win configure -width 600 -height 400

.win create 2dline {20 20 580 380} -color white -tags L1
.win create 2dline {580 20 20 380} -color white -tags L2
}
i_test overlay-1.2 {
One line should have turned red, the other green.
} {
.win itemconfigure L1 -color red
.win itemconfigure L2 -color green
}

i_test overlay-1.3 {
The red line should be 10 pixels thick, the green 5.
} {
.win itemconfigure L1 -width 10
.win itemconfigure L2 -width 5
}

i_test overlay-1.4 {
Turn on "-saveunder 3d". Nothing should change.
} {
.win configure -saveunder 3d
}

i_test overlay-1.5 {
Turn on "-saveunder none". Add a 2d polygon.
} {
.win configure -saveunder none
.win create 2dpolygon {300 100 400 200 300 300 200 200} -color blue
}

i_test overlay-1.6 {
Turn on "-saveunder 3d". Nothing should change.
} {
.win configure -saveunder 3d
}


