v0.0.494 add tables to wpdf
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Has been cancelled
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Has been cancelled
This commit is contained in:
24
imageext/types.go
Normal file
24
imageext/types.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package imageext
|
||||
|
||||
type Rectangle struct {
|
||||
X float64
|
||||
Y float64
|
||||
W float64
|
||||
H float64
|
||||
}
|
||||
|
||||
type PercentageRectangle struct {
|
||||
X float64 // [0..1]
|
||||
Y float64 // [0..1]
|
||||
W float64 // [0..1]
|
||||
H float64 // [0..1]
|
||||
}
|
||||
|
||||
func (r PercentageRectangle) Of(ref Rectangle) Rectangle {
|
||||
return Rectangle{
|
||||
X: ref.X + r.X*ref.W,
|
||||
Y: ref.Y + r.Y*ref.H,
|
||||
W: r.W * ref.W,
|
||||
H: r.H * ref.H,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user