[orx-panel] Fix Div such that it only consumes mouse events when it has a fill color
This commit is contained in:
@@ -2,17 +2,16 @@ package org.openrndr.panel.elements
|
|||||||
|
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.Drawer
|
import org.openrndr.draw.Drawer
|
||||||
import org.openrndr.panel.style.Color
|
import org.openrndr.panel.style.*
|
||||||
import org.openrndr.panel.style.Overflow
|
|
||||||
import org.openrndr.panel.style.background
|
|
||||||
import org.openrndr.panel.style.overflow
|
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
open class Div : TextElement(ElementType("div")) {
|
open class Div : TextElement(ElementType("div")) {
|
||||||
init {
|
init {
|
||||||
mouse.pressed.listen {
|
mouse.pressed.listen {
|
||||||
|
if (computedStyle.effectiveBackground?.alpha?:0.0 > 0.0) {
|
||||||
it.cancelPropagation()
|
it.cancelPropagation()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
mouse.scrolled.listen {
|
mouse.scrolled.listen {
|
||||||
computedStyle.let { cs ->
|
computedStyle.let { cs ->
|
||||||
if (cs.overflow != Overflow.Visible) {
|
if (cs.overflow != Overflow.Visible) {
|
||||||
|
|||||||
Reference in New Issue
Block a user