MCPcopy Create free account
hub / github.com/bqplot/bqplot / hasRotatedParent

Method hasRotatedParent

js/src/PanZoom.ts:107–124  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

105 }
106
107 hasRotatedParent(element) {
108 const parent = element.parentNode;
109 /* Base case: the element has no parent or the parent is the <html> element */
110 if (!parent || parent.tagName === 'HTML') {
111 return false;
112 }
113
114 /* Check if the parent is rotated */
115 const computedStyle = window.getComputedStyle(parent);
116 const transform = computedStyle.getPropertyValue('transform');
117
118 if (transform !== 'none' && !transform.startsWith('matrix(1, 0, 0, 1')) {
119 return true;
120 }
121
122 /* Recursively check the parent's parent */
123 return this.hasRotatedParent(parent);
124 }
125
126 mousePos() {
127 if (this.use_css_rotation_workaround) {

Callers 1

mousedownMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected