Mercurial > hg > forks > multipaint-js
changeset 99:cd6450dceec2
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Jul 2018 03:18:53 +0300 |
parents | c3aeb8acaa6c |
children | 51014de89824 |
files | Interface.pde |
diffstat | 1 files changed, 30 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/Interface.pde Fri Jul 06 02:59:47 2018 +0300 +++ b/Interface.pde Fri Jul 06 03:18:53 2018 +0300 @@ -617,45 +617,47 @@ clearmsg(); - - if (mode >= 1000) { + if (mode >= 1000) + { xc = int(xc); yc = int(yc); - if (g_phase == 1) { - switch (tool()) { - case 4: - case 6: + if (g_phase == 1) + switch (tool()) + { + case 4: + case 6: + xc = abs(g_rx2 - g_rx) + 1; + yc = abs(g_ry2 - g_ry) + 1; + break; + + case 7: + xc = abs(g_rx2 - g_rx) * 2 + 1; + yc = abs(g_ry2 - g_ry) * 2 + 1; + break; + + case 8: + if (g_data[int('c')] == 1 || g_shift) { + xc = abs(g_rx2 - g_rx); + yc = abs(g_ry2 - g_ry); + } //purkkaa + else { xc = abs(g_rx2 - g_rx) + 1; yc = abs(g_ry2 - g_ry) + 1; - break; - - case 7: - xc = abs(g_rx2 - g_rx) * 2 + 1; - yc = abs(g_ry2 - g_ry) * 2 + 1; - break; - - case 8: - if (g_data[int('c')] == 1 || g_shift) { - xc = abs(g_rx2 - g_rx); - yc = abs(g_ry2 - g_ry); - } //purkkaa - else { - xc = abs(g_rx2 - g_rx) + 1; - yc = abs(g_ry2 - g_ry) + 1; - } - break; - } + } + break; } // coordinates - if (xc < X && yc < Y) { + if (xc < X && yc < Y) + { printat(0, 0, "Px:"+ str(xc)); printat(6, 0, ", "+ str(yc)); printat(0, 1, "Ch:"+ str(int(xc / 8))); printat(6, 1, ", "+ str(int(yc / 8))); - if (tool() == 6 && g_phase == 1) { + if (tool() == 6 && g_phase == 1) + { float av = getangel(g_rx2 - g_rx, g_ry2 - g_ry); printat(0, 2, nf(dist(0, 0, xc - 1, yc - 1), 0, 2)); @@ -787,10 +789,10 @@ teks = "Mirror Y|on/off"; break; case 'l': - teks = "Load data|bin/png"; + teks = "Load a Multipaint"; break; case 's': - teks = "Save as|[RMB=Save]|bin/png"; + teks = "Save as|[RMB=Save]|Multipaint"; break; case 'u': teks = "Undo u LMB|Redo U RMB";