mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
This commit is contained in:
1 parent
2cc6c121f8
commit
7f79d1e70a
18 files changed
+757
-129
No files matched your search
+5
-1
@@ -63,6 +63,7 @@ type editorResource struct {
|
||||
data []byte
|
||||
font *Font
|
||||
image *MultiMedia
|
||||
space *ColorSpace
|
||||
subset *editorFontSubset
|
||||
}
|
||||
|
||||
@@ -781,7 +782,7 @@ func (e *Editor) prepareObject(id string, object GraphicObject) (GraphicObject,
|
||||
return GraphicObject{}, fmt.Errorf("alpha must be between 0 and 255")
|
||||
}
|
||||
for _, color := range []*FillColor{fill, stroke} {
|
||||
if err := creationColor(color); err != nil {
|
||||
if err := e.editorColor(color); err != nil {
|
||||
return GraphicObject{}, &EditError{Code: EditUnsupportedColor, Err: err}
|
||||
}
|
||||
}
|
||||
@@ -890,6 +891,9 @@ func (e *Editor) TransformObject(page int, id string, dx, dy, scale float64) err
|
||||
// 入参: object 对象副本, dx 横向位移, dy 纵向位移, scale 正缩放比例
|
||||
// 返回: GraphicObject 变换后的对象, error 错误信息
|
||||
func transformEditorObject(object GraphicObject, dx, dy, scale float64) (GraphicObject, error) {
|
||||
if object.Type == "CompositeObject" || object.Type == "CompositeGraphicUnit" || object.Type == "TextObject" && (len(object.TextObject.CGTransform) != 0 || object.TextObject.VScale != 0 || object.TextObject.Decoration != "") {
|
||||
return transformEditorMatrix(object, Matrix{a: scale, d: scale, e: dx, f: dy}), nil
|
||||
}
|
||||
var boundary, ctm *string
|
||||
switch object.Type {
|
||||
case "TextObject":
|
||||
|
||||
Reference in new issue
Block a user