Apply patch from issue 26, thanks to Ethan Burns
This commit is contained in:
parent
fb2948a31e
commit
b864adcd21
1 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ func NewGraphicContext(img draw.Image) *ImageGraphicContext {
|
||||||
width, height := img.Bounds().Dx(), img.Bounds().Dy()
|
width, height := img.Bounds().Dx(), img.Bounds().Dy()
|
||||||
dpi := 92
|
dpi := 92
|
||||||
ftContext := freetype.NewContext()
|
ftContext := freetype.NewContext()
|
||||||
ftContext.SetDPI(dpi)
|
ftContext.SetDPI(float64(dpi))
|
||||||
ftContext.SetClip(img.Bounds())
|
ftContext.SetClip(img.Bounds())
|
||||||
ftContext.SetDst(img)
|
ftContext.SetDst(img)
|
||||||
gc := &ImageGraphicContext{
|
gc := &ImageGraphicContext{
|
||||||
|
@ -65,7 +65,7 @@ func NewGraphicContextWithPainter(img draw.Image, painter Painter) *ImageGraphic
|
||||||
width, height := img.Bounds().Dx(), img.Bounds().Dy()
|
width, height := img.Bounds().Dx(), img.Bounds().Dy()
|
||||||
dpi := 92
|
dpi := 92
|
||||||
ftContext := freetype.NewContext()
|
ftContext := freetype.NewContext()
|
||||||
ftContext.SetDPI(dpi)
|
ftContext.SetDPI(float64(dpi))
|
||||||
ftContext.SetClip(img.Bounds())
|
ftContext.SetClip(img.Bounds())
|
||||||
ftContext.SetDst(img)
|
ftContext.SetDst(img)
|
||||||
gc := &ImageGraphicContext{
|
gc := &ImageGraphicContext{
|
||||||
|
@ -82,7 +82,7 @@ func NewGraphicContextWithPainter(img draw.Image, painter Painter) *ImageGraphic
|
||||||
|
|
||||||
func (gc *ImageGraphicContext) SetDPI(dpi int) {
|
func (gc *ImageGraphicContext) SetDPI(dpi int) {
|
||||||
gc.DPI = dpi
|
gc.DPI = dpi
|
||||||
gc.freetype.SetDPI(dpi)
|
gc.freetype.SetDPI(float64(dpi))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gc *ImageGraphicContext) GetDPI() int {
|
func (gc *ImageGraphicContext) GetDPI() int {
|
||||||
|
|
Loading…
Reference in a new issue