fix: line editor points rendering below elements (#5781)

* fix: line editor points rendering below elements

* add test
This commit is contained in:
David Luzar
2022-11-05 11:35:53 +01:00
committed by GitHub
parent 25ea97d0f9
commit 0228646507
2 changed files with 61 additions and 10 deletions

View File

@ -406,6 +406,8 @@ export const _renderScene = ({
}),
);
let editingLinearElement: NonDeleted<ExcalidrawLinearElement> | undefined =
undefined;
visibleElements.forEach((element) => {
try {
renderElement(element, rc, context, renderConfig);
@ -414,15 +416,10 @@ export const _renderScene = ({
// correct element from visible elements
if (appState.editingLinearElement?.elementId === element.id) {
if (element) {
renderLinearPointHandles(
context,
appState,
renderConfig,
element as NonDeleted<ExcalidrawLinearElement>,
);
editingLinearElement =
element as NonDeleted<ExcalidrawLinearElement>;
}
}
if (!isExporting) {
renderLinkIcon(element, context, appState);
}
@ -431,6 +428,15 @@ export const _renderScene = ({
}
});
if (editingLinearElement) {
renderLinearPointHandles(
context,
appState,
renderConfig,
editingLinearElement,
);
}
// Paint selection element
if (appState.selectionElement) {
try {