fix: Drawing settings panel UI and interaction bugs (close button, text color palette, keyboard propagation)
This commit is contained in:
@ -1206,6 +1206,7 @@ export class DrawingManager {
|
|||||||
let startX, startY, initialX, initialY;
|
let startX, startY, initialX, initialY;
|
||||||
|
|
||||||
header.addEventListener('mousedown', (e) => {
|
header.addEventListener('mousedown', (e) => {
|
||||||
|
if (e.target.closest('button')) return; // Allow clicking the close button
|
||||||
isDragging = true;
|
isDragging = true;
|
||||||
startX = e.clientX;
|
startX = e.clientX;
|
||||||
startY = e.clientY;
|
startY = e.clientY;
|
||||||
@ -1329,6 +1330,10 @@ export class DrawingManager {
|
|||||||
this.applySettings('text', e.target.value);
|
this.applySettings('text', e.target.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById('tlTextInput').addEventListener('keydown', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
document.getElementById('tlAlignVert').addEventListener('change', (e) => {
|
document.getElementById('tlAlignVert').addEventListener('change', (e) => {
|
||||||
this.applySettings('alignVert', e.target.value);
|
this.applySettings('alignVert', e.target.value);
|
||||||
});
|
});
|
||||||
@ -1400,7 +1405,6 @@ export class DrawingManager {
|
|||||||
if (isLineWithText) {
|
if (isLineWithText) {
|
||||||
if (textColorBtn && textPicker) {
|
if (textColorBtn && textPicker) {
|
||||||
textColorBtn.style.backgroundColor = settings.textColor || settings.color;
|
textColorBtn.style.backgroundColor = settings.textColor || settings.color;
|
||||||
textPicker.classList.remove('hidden');
|
|
||||||
}
|
}
|
||||||
fontInput.value = settings.fontSize || 14;
|
fontInput.value = settings.fontSize || 14;
|
||||||
textInput.value = settings.text || '';
|
textInput.value = settings.text || '';
|
||||||
|
|||||||
Reference in New Issue
Block a user