Gofmt
This commit is contained in:
parent
41d8a21ba2
commit
0b3b26d85f
|
@ -130,8 +130,8 @@ const (
|
||||||
|
|
||||||
func (cap LineCap) String() string {
|
func (cap LineCap) String() string {
|
||||||
return map[LineCap]string{
|
return map[LineCap]string{
|
||||||
RoundCap: "round",
|
RoundCap: "round",
|
||||||
ButtCap: "cap",
|
ButtCap: "cap",
|
||||||
SquareCap: "square",
|
SquareCap: "square",
|
||||||
}[cap]
|
}[cap]
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,8 +132,6 @@ func toSvgPathDesc(p *draw2d.Path) string { // TODO move elsewhere
|
||||||
nom := math.Hypot(ry*cosfi, rx*sinfi)
|
nom := math.Hypot(ry*cosfi, rx*sinfi)
|
||||||
x := cx + (rx*ry*cosfi)/nom
|
x := cx + (rx*ry*cosfi)/nom
|
||||||
y := cy + (rx*ry*sinfi)/nom
|
y := cy + (rx*ry*sinfi)/nom
|
||||||
x += 0.001 // dirty hack to ensure whole arc is drawn if start point equals endpoint
|
|
||||||
y += 0.001
|
|
||||||
|
|
||||||
// compute large and sweep flags
|
// compute large and sweep flags
|
||||||
large := 0
|
large := 0
|
||||||
|
@ -144,6 +142,15 @@ func toSvgPathDesc(p *draw2d.Path) string { // TODO move elsewhere
|
||||||
if !math.Signbit(ps[5]) {
|
if !math.Signbit(ps[5]) {
|
||||||
sweep = 1
|
sweep = 1
|
||||||
}
|
}
|
||||||
|
// dirty hack to ensure whole arc is drawn
|
||||||
|
// if start point equals end point
|
||||||
|
if sweep == 1 {
|
||||||
|
x += 0.001 * sinfi
|
||||||
|
y += 0.001 * -cosfi
|
||||||
|
} else {
|
||||||
|
x += 0.001 * sinfi
|
||||||
|
y += 0.001 * cosfi
|
||||||
|
}
|
||||||
|
|
||||||
// rx ry x-axis-rotation large-arc-flag sweep-flag x y
|
// rx ry x-axis-rotation large-arc-flag sweep-flag x y
|
||||||
parts[i] = fmt.Sprintf("A %.4f %.4f %v %v %v %.4f %.4f",
|
parts[i] = fmt.Sprintf("A %.4f %.4f %v %v %v %.4f %.4f",
|
||||||
|
|
4
font.go
4
font.go
|
@ -8,8 +8,8 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"sync"
|
|
||||||
"github.com/golang/freetype/truetype"
|
"github.com/golang/freetype/truetype"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FontStyle defines bold and italic styles for the font
|
// FontStyle defines bold and italic styles for the font
|
||||||
|
@ -168,8 +168,6 @@ type SyncFolderFontCache struct {
|
||||||
namer FontFileNamer
|
namer FontFileNamer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// NewSyncFolderFontCache creates SyncFolderFontCache
|
// NewSyncFolderFontCache creates SyncFolderFontCache
|
||||||
func NewSyncFolderFontCache(folder string) *SyncFolderFontCache {
|
func NewSyncFolderFontCache(folder string) *SyncFolderFontCache {
|
||||||
return &SyncFolderFontCache{
|
return &SyncFolderFontCache{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
package draw2d_test
|
package draw2d_test
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/llgcode/draw2d"
|
"github.com/llgcode/draw2d"
|
||||||
|
|
Loading…
Reference in New Issue