@@ -85,7 +85,8 @@ export class SceneFixture {
85
85
convertPagePositionToStream = async (
86
86
x : number ,
87
87
y : number ,
88
- format : 'pixels' | 'ratio' | undefined = 'pixels'
88
+ format : 'pixels' | 'ratio' | undefined = 'pixels' ,
89
+ relativeToStream = false
89
90
) => {
90
91
const viewportSize = this . page . viewportSize ( )
91
92
const streamBoundingBox = await this . streamWrapper . boundingBox ( )
@@ -99,11 +100,11 @@ export class SceneFixture {
99
100
const resolvedX =
100
101
( x / ( format === 'pixels' ? viewportSize . width : 1 ) ) *
101
102
streamBoundingBox . width +
102
- streamBoundingBox . x
103
+ ( relativeToStream ? 0 : streamBoundingBox . x )
103
104
const resolvedY =
104
105
( y / ( format === 'pixels' ? viewportSize . height : 1 ) ) *
105
106
streamBoundingBox . height +
106
- streamBoundingBox . y
107
+ ( relativeToStream ? 0 : streamBoundingBox . y )
107
108
108
109
const resolvedPoint = {
109
110
x : Math . round ( resolvedX ) ,
@@ -203,12 +204,14 @@ export class SceneFixture {
203
204
const resolvedToPoint = await this . convertPagePositionToStream (
204
205
x ,
205
206
y ,
206
- format
207
+ format ,
208
+ true
207
209
)
208
210
const resolvedFromPoint = await this . convertPagePositionToStream (
209
211
dragToParams . fromPoint . x ,
210
212
dragToParams . fromPoint . y ,
211
- format
213
+ format ,
214
+ true
212
215
)
213
216
if ( debug ) {
214
217
console . log ( {
@@ -239,12 +242,14 @@ export class SceneFixture {
239
242
const resolvedFromPoint = await this . convertPagePositionToStream (
240
243
x ,
241
244
y ,
242
- format
245
+ format ,
246
+ true
243
247
)
244
248
const resolvedToPoint = await this . convertPagePositionToStream (
245
249
dragFromParams . toPoint . x ,
246
250
dragFromParams . toPoint . y ,
247
- format
251
+ format ,
252
+ true
248
253
)
249
254
if ( debug ) {
250
255
console . log ( {
0 commit comments