[orx-panel] Fix Div such that it only consumes mouse events when it has a fill color

This commit is contained in:
Edwin Jakobs
2022-09-25 13:12:20 +02:00
parent 073fcad54b
commit 227c82f73a

View File

@@ -2,16 +2,15 @@ package org.openrndr.panel.elements
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.Drawer
import org.openrndr.panel.style.Color
import org.openrndr.panel.style.Overflow
import org.openrndr.panel.style.background
import org.openrndr.panel.style.overflow
import org.openrndr.panel.style.*
import kotlin.math.max
open class Div : TextElement(ElementType("div")) {
init {
mouse.pressed.listen {
it.cancelPropagation()
if (computedStyle.effectiveBackground?.alpha?:0.0 > 0.0) {
it.cancelPropagation()
}
}
mouse.scrolled.listen {
computedStyle.let { cs ->