tweaks.
This commit is contained in:
parent
3fe53d76d8
commit
8f0751f743
|
@ -191,7 +191,7 @@ func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bo
|
|||
// recalc recalculates scale and bounds values from the font size, screen
|
||||
// resolution and font metrics, and invalidates the glyph cache.
|
||||
func (rgc *RasterGraphicContext) recalc() {
|
||||
rgc.current.Scale = rgc.current.FontSizePoints * float64(rgc.DPI)
|
||||
rgc.current.Scale = rgc.current.FontSizePoints * float64(rgc.DPI) * 64.0 / 72.0
|
||||
}
|
||||
|
||||
// SetFont sets the font used to draw text.
|
||||
|
|
|
@ -80,8 +80,7 @@ func MeasureAnnotation(r Renderer, canvasBox Box, xrange, yrange Range, s Style,
|
|||
func DrawAnnotation(r Renderer, canvasBox Box, xrange, yrange Range, s Style, lx, ly int, label string) {
|
||||
r.SetFont(s.GetFont())
|
||||
r.SetFontSize(s.GetFontSize(DefaultAnnotationFontSize))
|
||||
textWidth, _ := r.MeasureText(label)
|
||||
textHeight := int(math.Floor(DefaultAnnotationFontSize))
|
||||
textWidth, textHeight := r.MeasureText(label)
|
||||
halfTextHeight := textHeight >> 1
|
||||
|
||||
pt := s.Padding.GetTop(DefaultAnnotationPadding.Top)
|
||||
|
|
Loading…
Reference in New Issue
Block a user