changeset 136:12cf30907f26

More work on integrating changes from v1.8.2018
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 09 Aug 2018 13:09:39 +0300
parents 72ae62f2036b
children d6f60370b3e7
files draw_outputs.pde draw_smart.pde events.pde multipaint.pde
diffstat 4 files changed, 33 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/draw_outputs.pde	Wed Aug 08 11:16:18 2018 +0300
+++ b/draw_outputs.pde	Thu Aug 09 13:09:39 2018 +0300
@@ -967,20 +967,8 @@
 
     //handles different tool behavior
     if (g_data[int('m')] == 0 && g_data[int('M')] == 0) {
-        if (g_uizoom == 1) {
-            x = int(qqx / 2);
-            y = int(qqy / 2);
-        }
-        else
-        if (g_uizoom == 2) {
-            x = int(qqx / 3);
-            y = int(qqy / 3);
-        }
-        else
-        if (g_uizoom == 3) {
-            x = int(qqx / 4);
-            y = int(qqy / 4);
-        }
+        x = int(qqx / psizex);
+        y = int(qqy / psizey);
     } else
     if (g_data[int('m')] == 1 || g_data[int('M')] == 1) {
         x = int(qqx / psizex) + g_ofx * 8;
@@ -1105,6 +1093,9 @@
                 else
                     floodfill_iq(ox, oy, mbut);
             }
+            else
+                changeborder(mbut);
+
             restoreparameters();
         }
     }
--- a/draw_smart.pde	Wed Aug 08 11:16:18 2018 +0300
+++ b/draw_smart.pde	Thu Aug 09 13:09:39 2018 +0300
@@ -109,6 +109,24 @@
 }
 
 
+void changeborder(int mbut)
+{
+    if (machine == MSX || machine == QLLOW || machine == AMIGA ||
+        machine == PICO8 || machine == BK0010 || machine == COCO3)
+        return;
+
+    int par = g_farge;
+    store_undo();
+    message("Set border");
+    if (mbut == LEFT) par = g_farge;
+    if (mbut == RIGHT) par = g_backg;
+    g_map[0] = byte(zxcolor(par));
+    sussborder();
+    g_boxreconstruct = 2;
+    refresh_all();
+}
+
+
 void floodfill_init(int xx, int yy)
 {
     for (x = 0; x < X; x++)
--- a/events.pde	Wed Aug 08 11:16:18 2018 +0300
+++ b/events.pde	Thu Aug 09 13:09:39 2018 +0300
@@ -83,6 +83,14 @@
 }
 
 
+void mouseWheel(processing.event.MouseEvent event)
+{
+    float e = event.getCount();
+    if (e < -0.1) command(g_wheelup);
+    if (e > 0.1) command(g_wheeldown);
+}
+
+
 void mouseDragged()
 {
     int msx, msy;
--- a/multipaint.pde	Wed Aug 08 11:16:18 2018 +0300
+++ b/multipaint.pde	Thu Aug 09 13:09:39 2018 +0300
@@ -22,6 +22,7 @@
 int g_rband, g_rbang, g_boxreconstruct, g_charlimit;
 int g_animx, g_animy, g_animframes, g_animno, g_animtime, g_animspeed;
 int g_omag, g_bordh, g_bordv, g_keymacpos;
+int g_wheelup = int(':'), g_wheeldown = int(';'), g_middlebutton = int(',');
 
 boolean g_control = false, g_shift = false, g_dirty;
 
@@ -498,7 +499,7 @@
     viewport();
     //magport();
     switcher(1);
-    update_ui();
+    update_ui(false);
     updatePixels();
 
     // Message control