mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 14:53:44 +08:00
1 parent
5dcd7a4e8d
commit
6c14eef1ee
39 files changed
+1926
-420
No files matched your search
@@ -67,6 +67,16 @@ func (CanvasBackend) Bounds(path GeometryPath) (Box, error) {
|
||||
// 入参: path 页面路径, matrix 页面变换
|
||||
// 返回: GeometryPath 新路径, error 无效路径错误
|
||||
func (CanvasBackend) Transform(path GeometryPath, matrix Matrix) (GeometryPath, error) {
|
||||
curves := true
|
||||
for _, segment := range path {
|
||||
if segment.Verb == GeometryArc {
|
||||
curves = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if curves {
|
||||
return path.Transform(matrix)
|
||||
}
|
||||
p, err := geometryToCanvasPath(&path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user