Skip to content

Commit

Permalink
oops, formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Nov 28, 2018
1 parent b499207 commit f9b680a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions driver/gl/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ func (c *glCanvas) drawText(text *canvas.Text, pos fyne.Position, frame fyne.Siz
containerSize := text.CurrentSize()
switch text.Alignment {
case fyne.TextAlignTrailing:
pos = fyne.NewPos(pos.X + containerSize.Width - size.Width, pos.Y)
pos = fyne.NewPos(pos.X+containerSize.Width-size.Width, pos.Y)
case fyne.TextAlignCenter:
pos = fyne.NewPos(pos.X + (containerSize.Width - size.Width)/2, pos.Y)
pos = fyne.NewPos(pos.X+(containerSize.Width-size.Width)/2, pos.Y)
}

if text.CurrentSize().Height > text.MinSize().Height {
pos = fyne.NewPos(pos.X, pos.Y + (text.CurrentSize().Height-text.MinSize().Height)/2)
pos = fyne.NewPos(pos.X, pos.Y+(text.CurrentSize().Height-text.MinSize().Height)/2)
}

points := c.rectCoords(size, pos, frame)
Expand Down
2 changes: 1 addition & 1 deletion driver/gl/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func fontCache() *truetype.Font {

func (d *gLDriver) RenderedTextSize(text string, size int, style fyne.TextStyle) fyne.Size {
var opts truetype.Options

opts.Size = float64(size)

face := truetype.NewFace(fontCache(), &opts)
advance := font.MeasureString(face, text)

Expand Down

0 comments on commit f9b680a

Please sign in to comment.