Show color picker icon

This commit is contained in:
MathemanFlo
2022-03-15 22:06:38 +01:00
parent 0d5a205f48
commit 3c0bae578b
+7 -1
View File
@@ -815,7 +815,7 @@ class UISidebar {
} }
// Show picked material next to cursor // Show picked material next to cursor
if (Context.tool == ToolPicker && Context.pickerSelectMaterial) { if (Context.tool == ToolPicker && Context.pickerSelectMaterial && Context.colorPickerCallback == null) {
var img = Context.material.imageIcon; var img = Context.material.imageIcon;
#if kha_opengl #if kha_opengl
g.drawScaledImage(img, mx + 10, my + 10 + img.height, img.width, -img.height); g.drawScaledImage(img, mx + 10, my + 10 + img.height, img.width, -img.height);
@@ -823,6 +823,12 @@ class UISidebar {
g.drawImage(img, mx + 10, my + 10); g.drawImage(img, mx + 10, my + 10);
#end #end
} }
if (Context.tool == ToolPicker && Context.colorPickerCallback != null) {
var img = Res.get("icons.k");
var rect = Res.tile50(img, ToolPicker, 0);
g.drawSubImage(img, mx + 10, my + 10, rect.x, rect.y, rect.w, rect.h);
}
var cursorImg = Res.get("cursor.k"); var cursorImg = Res.get("cursor.k");
var psize = Std.int(cursorImg.width * (Context.brushRadius * Context.brushNodesRadius) * ui.SCALE()); var psize = Std.int(cursorImg.width * (Context.brushRadius * Context.brushNodesRadius) * ui.SCALE());