kolibrios-gitea/programs/cmm/iconedit/tools/pencil.h
Kirill Lipatov (Leency) bc9841dbb6 IconEdit 0.52: better cursors, fix pencil tool
git-svn-id: svn://kolibrios.org@7264 a494cfbc-eb01-0410-851d-a64ba20cac60
2018-04-30 15:27:13 +00:00

26 lines
541 B
C

bool PencilTool_Drawing = false;
void PencilTool_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) {
if (canvas.hovered())
{
if ((PencilTool_Drawing == true) && (!mouse.key)) {
PencilTool_Drawing = false;
}
if (mouse.key) {
image.set_pixel(hoverY, hoverX, tool_color);
DrawCanvasPixel(hoverY, hoverX, tool_color);
PencilTool_Drawing = true;
}
if (mouse.up) {
DrawPreview();
actionsHistory.saveCurrentState();
}
}
}
void PencilTool_reset() {
PencilTool_Drawing = false;
}