Improve brush handling

This commit is contained in:
luboslenco
2019-02-26 13:31:00 +01:00
parent 39bb456928
commit dd0d354ba9
3 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -19,7 +19,8 @@ class Uniforms {
return r;
}
else if (link == '_brushOpacity') {
return UITrait.inst.brushOpacity * UITrait.inst.brushNodesOpacity;
return UITrait.inst.brushOpacity * UITrait.inst.brushOpacity *
UITrait.inst.brushNodesOpacity * UITrait.inst.brushNodesOpacity;
}
else if (link == '_brushScale') {
return (UITrait.inst.brushScale * UITrait.inst.brushNodesScale) * 2.0;
+1 -1
View File
@@ -27,7 +27,7 @@ class BrushOutputNode extends LogicNode {
// Paint bounds
if (arm.UITrait.inst.paintVec.x < 1 && arm.UITrait.inst.paintVec.x > 0 &&
arm.UITrait.inst.paintVec.y < 1 && arm.UITrait.inst.paintVec.y > 0 &&
!arm.UITrait.inst.ui.isHovered) { // Header combos are hovered
!arm.UITrait.inst.ui.isHovered && !arm.UITrait.inst.ui.isScrolling) { // Header combos are in use
// Set color pick
var down = iron.system.Input.getMouse().down() || iron.system.Input.getPen().down();
if (arm.UITrait.inst.brushType == 4 && arm.UITrait.inst.assets.length > 0 && down) {
@@ -251,9 +251,11 @@ class RenderPathDeferred {
}
//
#if (!kha_opengl)
path.setDepthFrom("bufa", "texpaint" + tid); // Unbind depth so we can read it
path.setDepthFrom("texpaint" + tid, "bufb");
path.depthToRenderTarget.set("paintdb", path.renderTargets.get("bufa"));
#end
//
if (arm.UITrait.inst.paintHeight) {
@@ -278,8 +280,11 @@ class RenderPathDeferred {
path.drawMeshes("paint");
//
#if (!kha_opengl)
path.setDepthFrom("texpaint" + tid, "bufa"); // Re-bind depth
path.setDepthFrom("bufa", "bufb");
path.depthToRenderTarget.set("paintdb", path.renderTargets.get("texpaint" + tid));
#end
//
}
}