You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What is a short input program that triggers the error?
// should print {0 300} but prints {0 -500} instead.
// changing Bbox to a value method fixes it. as does splitting
// the calculation up.
package main
import (
"exp/draw"
"fmt"
)
type Obj struct {
bbox draw.Rectangle
}
func (o *Obj) Bbox() draw.Rectangle {
return o.bbox
}
func main() {
obj := &Obj{draw.Rect(800, 0, 0, 0)}
p := draw.Pt(800, 300)
fmt.Printf("%v\n", calc(obj, p))
}
func calc(obj *Obj, p draw.Point) draw.Point {
return p.Sub(obj.Bbox().Min)
}
2. What is the full compiler output?
it compiles ok.
3. What version of the compiler are you using? (Run it with the -V flag.)
8g version 5516+
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: