cursor simplification
This commit is contained in:
parent
0508622a9a
commit
8c27e16314
|
|
@ -85,10 +85,7 @@ const styles = css`
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[part='resize-top-left'],
|
[part^='resize'] {
|
||||||
[part='resize-top-right'],
|
|
||||||
[part='resize-bottom-right'],
|
|
||||||
[part='resize-bottom-left'] {
|
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
@ -122,16 +119,6 @@ const styles = css`
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[part='resize-top-left'],
|
|
||||||
[part='resize-bottom-right'] {
|
|
||||||
cursor: var(--resize-handle-cursor-nw);
|
|
||||||
}
|
|
||||||
|
|
||||||
[part='resize-top-right'],
|
|
||||||
[part='resize-bottom-left'] {
|
|
||||||
cursor: var(--resize-handle-cursor-ne);
|
|
||||||
}
|
|
||||||
|
|
||||||
[part^='rotation'] {
|
[part^='rotation'] {
|
||||||
z-index: calc(infinity);
|
z-index: calc(infinity);
|
||||||
display: block;
|
display: block;
|
||||||
|
|
@ -142,7 +129,6 @@ const styles = css`
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
cursor: var(--fc-rotate, url('${getRotateCursorUrl(0)}') 16 16, pointer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[part='rotation-top-left'] {
|
[part='rotation-top-left'] {
|
||||||
|
|
@ -171,8 +157,7 @@ const styles = css`
|
||||||
|
|
||||||
:host(:not(:focus-within)) [part^='resize'],
|
:host(:not(:focus-within)) [part^='resize'],
|
||||||
:host(:not(:focus-within)) [part^='rotation'] {
|
:host(:not(:focus-within)) [part^='rotation'] {
|
||||||
opacity: 0;
|
display: none;
|
||||||
cursor: default;
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
@ -299,6 +284,8 @@ export class FolkShape extends HTMLElement {
|
||||||
])
|
])
|
||||||
) as Record<ResizeHandle | RotateHandle, HTMLElement>;
|
) as Record<ResizeHandle | RotateHandle, HTMLElement>;
|
||||||
|
|
||||||
|
this.#updateCursors();
|
||||||
|
|
||||||
this.x = Number(this.getAttribute('x')) || 0;
|
this.x = Number(this.getAttribute('x')) || 0;
|
||||||
this.y = Number(this.getAttribute('y')) || 0;
|
this.y = Number(this.getAttribute('y')) || 0;
|
||||||
this.width = Number(this.getAttribute('width')) || 'auto';
|
this.width = Number(this.getAttribute('width')) || 'auto';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue