mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-24 13:48:49 +08:00
Account for inverted annotation rects when calculation appearance bounds (#357)
This commit is contained in:
parent
d2941b5477
commit
033f410eac
@ -168,16 +168,12 @@ func genFieldTextAppearance(wa *model.PdfAnnotationWidget, ftxt *model.PdfFieldT
|
||||
if !ok {
|
||||
return nil, errors.New("invalid Rect")
|
||||
}
|
||||
rect, err := array.ToFloat64Array()
|
||||
rect, err := model.NewPdfRectangle(*array)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(rect) != 4 {
|
||||
return nil, errors.New("len(Rect) != 4")
|
||||
}
|
||||
|
||||
width := rect[2] - rect[0]
|
||||
height := rect[3] - rect[1]
|
||||
width := rect.Width()
|
||||
height := rect.Height()
|
||||
|
||||
if mkDict, has := core.GetDict(wa.MK); has {
|
||||
bsDict, _ := core.GetDict(wa.BS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user