gofmt on package
This commit is contained in:
parent
873e6bfa2b
commit
b0cb20d244
5 changed files with 108 additions and 111 deletions
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
"image"
|
||||
"image/png"
|
||||
//"draw2d"
|
||||
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
"draw2d"
|
||||
//"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@ import (
|
|||
"exp/draw/x11"
|
||||
"image"
|
||||
"math"
|
||||
//"draw2d"
|
||||
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
"draw2d"
|
||||
//"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
)
|
||||
|
||||
func main() {
|
||||
window, err := x11.NewWindow()
|
||||
if(err != nil) {
|
||||
if err != nil {
|
||||
fmt.Printf("Cannot open an x11 window\n")
|
||||
return
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ func main() {
|
|||
|
||||
switch evt := (<-window.EventChan()).(type) {
|
||||
case draw.KeyEvent:
|
||||
if(evt.Key == 'q') {
|
||||
if evt.Key == 'q' {
|
||||
window.Close()
|
||||
}
|
||||
case draw.MouseEvent:
|
||||
if(evt.Buttons & 1 != 0) {
|
||||
if(nbclick % 2 == 0) {
|
||||
if evt.Buttons&1 != 0 {
|
||||
if nbclick%2 == 0 {
|
||||
gc.MoveTo(float(evt.Loc.X), float(evt.Loc.Y))
|
||||
} else {
|
||||
gc.LineTo(float(evt.Loc.X), float(evt.Loc.Y))
|
||||
|
|
|
@ -11,8 +11,8 @@ import (
|
|||
"math"
|
||||
"image"
|
||||
"image/png"
|
||||
//"draw2d"
|
||||
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
"draw2d"
|
||||
//"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -90,7 +90,6 @@ func android(gc *draw2d.GraphicContext, x, y float) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
func main() {
|
||||
i, gc := initGc(width, height)
|
||||
gc.SetFillColor(image.RGBAColor{0xff, 0x44, 0x44, 0xff})
|
||||
|
|
|
@ -13,8 +13,8 @@ import (
|
|||
"math"
|
||||
"image"
|
||||
"image/png"
|
||||
//"draw2d"
|
||||
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
"draw2d"
|
||||
//"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -136,7 +136,6 @@ func TestDrawArcNegative() {
|
|||
gc.SetFillColor(image.RGBAColor{255, 0x33, 0x33, 0x80})
|
||||
gc.SetLineWidth(6)
|
||||
|
||||
|
||||
gc.MoveTo(xc, yc)
|
||||
gc.LineTo(xc+cos(startAngle)*radiusX, yc+sin(startAngle)*radiusY)
|
||||
gc.MoveTo(xc, yc)
|
||||
|
|
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
"image"
|
||||
"image/png"
|
||||
//"draw2d"
|
||||
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
"draw2d"
|
||||
//"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -116,7 +116,6 @@ func gordon(gc *draw2d.GraphicContext, x, y, w, h float) {
|
|||
draw2d.RoundRect(gc, x+w/2, y+h+30, x+w/2+w/8, y+h+30+w/6, 5, 5) // right tooth
|
||||
gc.Fill()
|
||||
|
||||
|
||||
draw2d.Ellipse(gc, x+(w/2), y+h+30, w/6, w/12) // snout
|
||||
gc.SetFillColor(nf)
|
||||
gc.Fill()
|
||||
|
|
Loading…
Reference in a new issue