1 // $G $D/$F.go && $L $F.$A && ./$A.out
3 // Copyright 2010 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // http://code.google.com/p/go/issues/detail?id=807
19 func (p Point
) Sub(q Point
) Point
{
20 return Point
{p
.X
-q
.X
, p
.Y
-q
.Y
}
27 func (o
*Obj
) Bbox() Rect
{
31 func (o
*Obj
) Points() [2]Point
{
32 return [2]Point
{o
.bbox
.Min
, o
.bbox
.Max
}
38 o
:= &Obj
{Rect
{Point
{800, 0}, Point
{}}}
40 q
:= p
.Sub(o
.Bbox().Min
)
41 if q
.X
!= 0 || q
.Y
!= 300 {
42 println("BUG dot: ", q
.X
, q
.Y
)
46 q
= p
.Sub(o
.Points()[0])
47 if q
.X
!= 0 || q
.Y
!= 300 {
48 println("BUG index const: ", q
.X
, q
.Y
)
51 q
= p
.Sub(o
.Points()[x
])
52 if q
.X
!= 0 || q
.Y
!= 300 {
53 println("BUG index var: ", q
.X
, q
.Y
)