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