File tree 4 files changed +30
-8
lines changed
4 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ html(lang='en')
15
15
include ../node_modules/reset-css/reset.css
16
16
include ./demo.css
17
17
body
18
- include ../test/svg-composition.pug
18
+ // - include ../test/svg-composition.pug
19
+ include ../test/scroll.pug
19
20
//.super(style="height: 200px; width: 200px;")
20
21
//div(style="margin-top: 40px; margin-left: 40px")
21
22
// div(style="margin-top: 40px")
@@ -27,12 +28,12 @@ html(lang='en')
27
28
.referentiel
28
29
.pointer
29
30
//div(style="margin-top: 14px")
30
- div( style ="position: relative; top: 40px; left: 40px" )
31
- p Hello World
32
- div
33
- div( style ="position: absolute; top: 40px; left: 50px;" )
34
- .referentiel
35
- .pointer
31
+ // - div(style="position: relative; top: 40px; left: 40px")
32
+ // - p Hello World
33
+ // - div
34
+ // - div(style="position: absolute; top: 40px; left: 50px;")
35
+ // - .referentiel
36
+ // - .pointer
36
37
//div(style="position: absolute; top: 40px; left: 50px;")
37
38
.referentiel
38
39
.pointer
Original file line number Diff line number Diff line change @@ -107,7 +107,8 @@ class Referentiel {
107
107
this . matrixTransformOrigin ( ) ,
108
108
this . matrixTransform ( ) ,
109
109
Referentiel . inv ( this . matrixTransformOrigin ( ) ) ,
110
- this . matrixBorder ( )
110
+ this . matrixBorder ( ) ,
111
+ this . matrixScroll ( )
111
112
) ;
112
113
}
113
114
@@ -168,6 +169,17 @@ class Referentiel {
168
169
] ;
169
170
}
170
171
172
+ matrixScroll ( ) : Matrix {
173
+ if ( ! ( this . reference instanceof HTMLElement ) ) return Referentiel . identity ( ) ;
174
+ const left = this . reference . scrollLeft ;
175
+ const top = this . reference . scrollTop ;
176
+ return [
177
+ [ 1 , 0 , - left ] ,
178
+ [ 0 , 1 , - top ] ,
179
+ [ 0 , 0 , 1 ] ,
180
+ ] ;
181
+ }
182
+
171
183
parent ( element : Node ) : Node | null {
172
184
if (
173
185
element . parentNode != null &&
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ describe("Pug", function () {
94
94
"absolute_tricky" ,
95
95
"absolute_stacked" ,
96
96
"absolute_transformations" ,
97
+ "scroll"
97
98
] ;
98
99
results = [ ] ;
99
100
for ( j = 0 , len = ref . length ; j < len ; j ++ ) {
Original file line number Diff line number Diff line change
1
+ div( style ="overflow:auto; width: 200px; height: 200px;" )
2
+ .referentiel ( style ="width: 5000px; height: 5000px;" )
3
+ script .
4
+ document .scripts [document .scripts .length - 1 ].parentElement .parentElement .scrollTop = 50
5
+ document .scripts [document .scripts .length - 1 ].parentElement .parentElement .scrollLeft = 30
6
+ .assert ( data-assert ="0,0:30,50" )
7
+ .assert ( data-assert ="10,10:40,60" )
8
+
You can’t perform that action at this time.
0 commit comments