@@ -90,13 +90,16 @@ export default class Guide extends SuperComponent {
90
90
const highlightPadding = rpx2px ( step . highlightPadding ?? this . data . highlightPadding ) ;
91
91
const referenceTop = rect . top - highlightPadding ;
92
92
const referenceRight = systemInfo . windowWidth - rect . right - highlightPadding ;
93
- const referenceBottom = systemInfo . windowHeight - rect . bottom - highlightPadding ;
94
93
const referenceLeft = rect . left - highlightPadding ;
94
+ const referenceWidth = rect . width + 2 * highlightPadding ;
95
+ const referenceHeight = rect . height + 2 * highlightPadding ;
96
+
95
97
const style = {
96
98
top : `${ referenceTop } px` ,
97
99
right : `${ referenceRight } px` ,
98
- bottom : `${ referenceBottom } px` ,
99
100
left : `${ referenceLeft } px` ,
101
+ width : `${ referenceWidth } px` ,
102
+ height : `${ referenceHeight } px` ,
100
103
} ;
101
104
this . setData ( {
102
105
_steps : this . data . steps ,
@@ -213,12 +216,11 @@ export default class Guide extends SuperComponent {
213
216
const space = rpx2px ( 32 ) ;
214
217
const offsetLeft = ( offset ) => unitConvert ( isNumber ( offset ?. [ 0 ] ) ? `${ offset ?. [ 0 ] } rpx` : offset ?. [ 0 ] || 0 ) ;
215
218
const offsetTop = ( offset ) => unitConvert ( isNumber ( offset ?. [ 1 ] ) ? `${ offset ?. [ 1 ] } rpx` : offset ?. [ 1 ] || 0 ) ;
216
- const bottom = ( place ) => parseFloat ( place . bottom ) ;
217
219
const left = ( place ) => parseFloat ( place . left ) ;
218
220
const right = ( place ) => parseFloat ( place . right ) ;
219
221
const top = ( place ) => parseFloat ( place . top ) ;
220
- const height = ( place ) => systemInfo . windowHeight - bottom ( place ) - top ( place ) ;
221
- const width = ( place ) => systemInfo . windowWidth - left ( place ) - right ( place ) ;
222
+ const height = ( place ) => parseFloat ( place . height ) ;
223
+ const width = ( place ) => parseFloat ( place . width ) ;
222
224
return {
223
225
center : ( rect , place , offset ) => ( {
224
226
top : `${ Math . max ( height ( place ) + top ( place ) + space + offsetTop ( offset ) , 1 ) } px` ,
@@ -245,7 +247,7 @@ export default class Guide extends SuperComponent {
245
247
right : `${ Math . max ( width ( place ) + right ( place ) + space - offsetLeft ( offset ) , 1 ) } px` ,
246
248
} ) ,
247
249
'left-bottom' : ( rect , place , offset ) => ( {
248
- bottom : `${ Math . max ( bottom ( place ) - offsetTop ( offset ) , 1 ) } px` ,
250
+ top : `${ Math . max ( top ( place ) + height ( place ) - rect . height - offsetTop ( offset ) , 1 ) } px` ,
249
251
right : `${ Math . max ( width ( place ) + right ( place ) + space - offsetLeft ( offset ) , 1 ) } px` ,
250
252
} ) ,
251
253
right : ( rect , place , offset ) => ( {
@@ -257,19 +259,19 @@ export default class Guide extends SuperComponent {
257
259
left : `${ Math . max ( left ( place ) + width ( place ) + space + offsetLeft ( offset ) , 1 ) } px` ,
258
260
} ) ,
259
261
'right-bottom' : ( rect , place , offset ) => ( {
260
- bottom : `${ Math . max ( bottom ( place ) - offsetTop ( offset ) , 1 ) } px` ,
262
+ top : `${ Math . max ( top ( place ) + height ( place ) - rect . height - offsetTop ( offset ) , 1 ) } px` ,
261
263
left : `${ Math . max ( left ( place ) + width ( place ) + space + offsetLeft ( offset ) , 1 ) } px` ,
262
264
} ) ,
263
265
top : ( rect , place , offset ) => ( {
264
- bottom : `${ Math . max ( height ( place ) + bottom ( place ) + space - offsetTop ( offset ) , 1 ) } px` ,
266
+ top : `${ Math . max ( top ( place ) - rect . height - space + offsetTop ( offset ) , 1 ) } px` ,
265
267
left : `${ Math . max ( width ( place ) / 2 + left ( place ) - rect . width / 2 + offsetLeft ( offset ) , 1 ) } px` ,
266
268
} ) ,
267
269
'top-left' : ( rect , place , offset ) => ( {
268
- bottom : `${ Math . max ( height ( place ) + bottom ( place ) + space - offsetTop ( offset ) , 1 ) } px` ,
270
+ top : `${ Math . max ( top ( place ) - rect . height - space + offsetTop ( offset ) , 1 ) } px` ,
269
271
left : `${ Math . max ( left ( place ) + offsetLeft ( offset ) , 1 ) } px` ,
270
272
} ) ,
271
273
'top-right' : ( rect , place , offset ) => ( {
272
- bottom : `${ Math . max ( height ( place ) + bottom ( place ) + space - offsetTop ( offset ) , 1 ) } px` ,
274
+ top : `${ Math . max ( top ( place ) - rect . height - space + offsetTop ( offset ) , 1 ) } px` ,
273
275
right : `${ Math . max ( right ( place ) - offsetLeft ( offset ) , 1 ) } px` ,
274
276
} ) ,
275
277
} ;
0 commit comments