Mercurial > hg > forks > multipaint-js
changeset 186:74e1616ca38e
Micro-optimize draw().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 23 Aug 2018 14:27:28 +0300 |
parents | b4e8b8c1c3e3 |
children | 28caa87348d3 |
files | multipaint.pde |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/multipaint.pde Thu Aug 23 14:22:36 2018 +0300 +++ b/multipaint.pde Thu Aug 23 14:27:28 2018 +0300 @@ -598,7 +598,8 @@ // Tool drawing for shows int savebut = g_button; - if (tool() != 5) + int tt = tool(); + if (tt != 5) { if (g_phase == 0) g_button = LEFT; @@ -607,9 +608,9 @@ else storecoords(g_mx, g_my); - if (tool() == 6) do_line(g_rx, g_ry, g_rx2, g_ry2, 0); - if (tool() == 7) do_circle(g_rx, g_ry, g_rx2, g_ry2); - if (tool() == 8) do_rectangle(g_rx, g_ry, g_rx2, g_ry2); + if (tt == 6) do_line(g_rx, g_ry, g_rx2, g_ry2, 0); + if (tt == 7) do_circle(g_rx, g_ry, g_rx2, g_ry2); + if (tt == 8) do_rectangle(g_rx, g_ry, g_rx2, g_ry2); g_button = savebut; // Screen update stuff