Remove unnecessary util function

This commit is contained in:
Adrian-George Bostan 2018-11-18 11:13:53 +02:00
parent 9fd0b08297
commit 2c50caf6a4
2 changed files with 1 additions and 20 deletions

View File

@ -189,7 +189,7 @@ func (l *List) GeneratePageBlocks(ctx DrawContext) ([]*Block, DrawContext, error
marker.SetTextAlignment(TextAlignmentRight)
marker.Append(item.marker.Text).Style = item.marker.Style
width := round((marker.getTextWidth()/1000.0)/ctx.Width, 0.001, 3)
width := marker.getTextWidth() / 1000.0 / ctx.Width
if markerWidth < width {
markerWidth = width
}

View File

@ -6,7 +6,6 @@
package creator
import (
"math"
"os"
"github.com/unidoc/unidoc/pdf/model"
@ -44,21 +43,3 @@ func loadPagesFromFile(path string) ([]*model.PdfPage, error) {
return pages, nil
}
func round(val float64, roundOn float64, places int) float64 {
var round float64
pow := math.Pow(10, float64(places))
digit := pow * val
_, div := math.Modf(digit)
div = math.Copysign(div, val)
roundOn = math.Copysign(roundOn, val)
if div >= roundOn {
round = math.Ceil(digit)
} else {
round = math.Floor(digit)
}
return round / pow
}