Fix clipping controls for ThreeCanvas
This commit is contained in:
parent
da0f4c0ff0
commit
15ac3545b5
@ -116,7 +116,7 @@ public fun PropertyEditor(
|
||||
}
|
||||
}
|
||||
|
||||
CloseButton(editorPropertyState != EditorPropertyState.Defined){
|
||||
CloseButton(editorPropertyState != EditorPropertyState.Defined) {
|
||||
rootMeta.remove(name)
|
||||
update()
|
||||
}
|
||||
@ -163,7 +163,7 @@ public fun PropertyEditor(
|
||||
}
|
||||
}
|
||||
|
||||
awaitClose { properties.removeListener(scope) }
|
||||
awaitClose { properties.removeListener(scope) }
|
||||
},
|
||||
name = Name.EMPTY,
|
||||
rootDescriptor = descriptor,
|
||||
|
@ -155,9 +155,10 @@ public class ThreeCanvas(
|
||||
}
|
||||
|
||||
//Clipping planes
|
||||
options.useProperty(Canvas3DOptions::clipping) { clipping ->
|
||||
if (!clipping.meta.isEmpty()) {
|
||||
renderer.localClippingEnabled = true
|
||||
options.useProperty(Canvas3DOptions::clipping) { clipping: PointScheme ->
|
||||
if (clipping.meta.isEmpty()) {
|
||||
renderer.clippingPlanes = emptyArray()
|
||||
} else {
|
||||
boundingBox?.let { boundingBox ->
|
||||
val xClippingPlane = clipping.x?.let {
|
||||
val absoluteValue = boundingBox.min.x + (boundingBox.max.x - boundingBox.min.x) * it
|
||||
@ -175,8 +176,6 @@ public class ThreeCanvas(
|
||||
renderer.clippingPlanes =
|
||||
listOfNotNull(xClippingPlane, yClippingPlane, zClippingPlane).toTypedArray()
|
||||
}
|
||||
} else {
|
||||
renderer.localClippingEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user