Tweaks
This commit is contained in:
parent
c91c9ca89b
commit
aafa163bc8
1 changed files with 2 additions and 2 deletions
|
@ -125,10 +125,10 @@ func unsplash(broker *tg.Broker, update tg.APIMessage) {
|
||||||
|
|
||||||
// Still too big? Decrease font size again
|
// Still too big? Decrease font size again
|
||||||
iter := 0
|
iter := 0
|
||||||
for width*1.1 > iwidth && iter < 10 {
|
for width*1.05 > iwidth && iter < 10 {
|
||||||
log.Println("Warning, resizing!")
|
log.Println("Warning, resizing!")
|
||||||
left, top, right, bottom = gc.GetStringBounds(texts[longid])
|
left, top, right, bottom = gc.GetStringBounds(texts[longid])
|
||||||
scale *= (0.8 - 0.1*float64(iter))
|
scale *= (0.9 - 0.1*float64(iter))
|
||||||
gc.SetFontSize(scale)
|
gc.SetFontSize(scale)
|
||||||
width = right - left
|
width = right - left
|
||||||
iter++
|
iter++
|
||||||
|
|
Reference in a new issue