mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
a63e0cb44a
op.Offset is a convenience function most often used by layouts. Layouts usually operate in integer coordinates, and the float32 version of op.Offset needlessly force conversions from int to float32. This change makes op.Offset take integer coordinates, to better match its intended use. Signed-off-by: Elias Naur <mail@eliasnaur.com>
21 lines
320 B
Go
21 lines
320 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
package op
|
|
|
|
import (
|
|
"image"
|
|
"testing"
|
|
)
|
|
|
|
func TestTransformChecks(t *testing.T) {
|
|
defer func() {
|
|
if err := recover(); err == nil {
|
|
t.Error("cross-macro Pop didn't panic")
|
|
}
|
|
}()
|
|
var ops Ops
|
|
trans := Offset(image.Point{}).Push(&ops)
|
|
Record(&ops)
|
|
trans.Pop()
|
|
}
|