File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -556,9 +556,7 @@ export default {
556556 payload: img,
557557 file,
558558 }
559- this .allObjects = this .allObjects .map ((objects , pIndex ) =>
560- pIndex === this .selectedPageIndex ? [... objects, object] : objects,
561- )
559+ this .addObject (object)
562560 } catch (e) {
563561 console .log (' Fail to add image.' , e)
564562 }
@@ -584,9 +582,7 @@ export default {
584582 y,
585583 currentPage,
586584 }
587- this .allObjects = this .allObjects .map ((objects , pIndex ) =>
588- pIndex === this .selectedPageIndex ? [... objects, object] : objects,
589- )
585+ this .addObject (object)
590586 },
591587
592588 onAddDrawing () {
@@ -608,6 +604,10 @@ export default {
608604 width: originWidth * scale,
609605 scale,
610606 }
607+ this .addObject (object)
608+ },
609+
610+ addObject (object ) {
611611 this .allObjects = this .allObjects .map ((objects , pIndex ) =>
612612 pIndex === this .selectedPageIndex ? [... objects, object] : objects,
613613 )
You can’t perform that action at this time.
0 commit comments