@@ -51,8 +51,22 @@ export const resolveContent = async (
51
51
globals : InternalGlobals ,
52
52
run : RunOptionsBase
53
53
) => {
54
+ const possibleLastPos = globals . __LAST_POSITION__
55
+
56
+ let position =
57
+ typeof content !== 'string' && content ?. position
58
+ ? { x : app . x + content . position . x , y : app . y + content . position . y }
59
+ : { x : app . x , y : app . y }
60
+
61
+ if ( possibleLastPos ) {
62
+ position . x -= possibleLastPos . x
63
+ position . y -= possibleLastPos . y
64
+
65
+ globals . __LAST_POSITION__ = null
66
+ }
67
+
54
68
const addOnlyStringText = async ( str : string ) => {
55
- await app . text ( str , {
69
+ await app . text ( str , position . x , position . y , {
56
70
indent : defaults . text . indent ,
57
71
align : defaults . text . align ,
58
72
paragraphGap : defaults . text . paragraphMargin ,
@@ -68,17 +82,6 @@ export const resolveContent = async (
68
82
return
69
83
}
70
84
71
- const possibleLastPos = globals . __LAST_POSITION__
72
-
73
- let position = content ?. position
74
- ? { x : app . x + content . position . x , y : app . y + content . position . y }
75
- : { x : app . x , y : app . y }
76
-
77
- if ( possibleLastPos ) {
78
- position . x -= possibleLastPos . x
79
- position . y -= possibleLastPos . y
80
- }
81
-
82
85
const addStack = async ( ) => {
83
86
const stack = content . stack as Content [ ]
84
87
0 commit comments