Fix upable to paint in 2D editor

Fix hover issue with menu item side menu
This commit is contained in:
JannisX11 2023-05-27 20:53:54 +02:00
parent a275be5e04
commit 64caffaa28
2 changed files with 9 additions and 2 deletions

View File

@ -186,9 +186,14 @@ class Menu {
node.addClass('hybrid_parent'); node.addClass('hybrid_parent');
let more_button = Interface.createElement('div', {class: 'menu_more_button'}, Blockbench.getIconNode('more_horiz')); let more_button = Interface.createElement('div', {class: 'menu_more_button'}, Blockbench.getIconNode('more_horiz'));
node.append(more_button); node.append(more_button);
$(more_button).mouseenter(e => { more_button.addEventListener('mouseenter', e => {
scope.hover(node.get(0), e, true); scope.hover(node.get(0), e, true);
}) })
more_button.addEventListener('mouseleave', e => {
if (node.is(':hover') && !childlist.is(':hover')) {
scope.hover(node, e);
}
})
} }
} else { } else {
node.addClass('parent'); node.addClass('parent');

View File

@ -460,7 +460,9 @@ const Painter = {
let softness = BarItems.slider_brush_softness.get()/100; let softness = BarItems.slider_brush_softness.get()/100;
let b_opacity = BarItems.slider_brush_opacity.get()/255; let b_opacity = BarItems.slider_brush_opacity.get()/255;
let tool = Toolbox.selected; let tool = Toolbox.selected;
let matrix_id = Painter.current.element.uuid + Painter.current.face; let matrix_id = Painter.current.element
? (Painter.current.element.uuid + Painter.current.face)
: Painter.current.face;
ctx.clip() ctx.clip()
if (Painter.current.element instanceof Mesh) { if (Painter.current.element instanceof Mesh) {