This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efm2.

View the commit online.

commit 787d30fc3089407fe0d26f7c788f879b3fa2dd37
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Thu Aug 31 10:41:03 2023 +0100

    move invalid coords to a #define
---
 src/efm/efm.c          |  8 +++++---
 src/efm/efm_back_end.c | 12 ++++++------
 src/efm/efm_custom.c   |  4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/efm/efm.c b/src/efm/efm.c
index 8edf966..e00b1e6 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -18,6 +18,8 @@
 #define DND_OVER_OPEN_TIMER 1.0
 #define ICON_LONGPRESS_TIMER 1.0
 
+#define INVALID -999999
+
 #include "efm_structs.h"
 
 int _log_dom = -1;
@@ -1036,21 +1038,21 @@ _relayout_icons_custom(Smart_Data *sd)
      {
         EINA_LIST_FOREACH(block->icons, il, icon)
           { // icon is at urrent x,y
-             if (icon->geom.w == -9999)
+             if (icon->geom.w == INVALID)
                {
                   icon->geom.w = sd->icon_min_w;
                   icon->geom.h = sd->icon_min_h;
                }
              if (sd->listing_done)
                {
-                  if (icon->geom.x == -9999)
+                  if (icon->geom.x == INVALID)
                     _icon_custom_position_find(icon);
                   else
                     _icon_custom_position_placed(icon);
                }
              else
                {
-                  if (icon->geom.x != -9999)
+                  if (icon->geom.x != INVALID)
                     _icon_custom_position_placed(icon);
                }
              if (block->icons == il) // first icon in block
diff --git a/src/efm/efm_back_end.c b/src/efm/efm_back_end.c
index 249a323..989910f 100644
--- a/src/efm/efm_back_end.c
+++ b/src/efm/efm_back_end.c
@@ -275,7 +275,7 @@ static void
 _icon_xy_wh_get(Smart_Data *sd, Icon *icon, Cmd *c)
 {
    const char *s;
-   int x, y, w, h, raw_x = -9999, raw_y = -9999;
+   int x, y, w, h, raw_x = INVALID, raw_y = INVALID;
 
    s = cmd_key_find(c, "meta.xy");
    if (s)
@@ -295,7 +295,7 @@ _icon_xy_wh_get(Smart_Data *sd, Icon *icon, Cmd *c)
      {
         if (sscanf(s, "%ix%i", &w, &h) == 2)
           {
-             if (raw_x == -9999)
+             if (raw_x == INVALID)
                {
                   w = ((raw_x + w) * _scale_get(sd)) - icon->geom.x;
                   h = ((raw_y + h) * _scale_get(sd)) - icon->geom.y;
@@ -459,10 +459,10 @@ _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg)
 
              file_adds++;
              // initial "invalid" xy for custom location - meta overrides
-             icon->geom.x = -9999;
-             icon->geom.y = -9999;
-             icon->geom.w = -9999;
-             icon->geom.h = -9999;
+             icon->geom.x = INVALID;
+             icon->geom.y = INVALID;
+             icon->geom.w = INVALID;
+             icon->geom.h = INVALID;
              icon->sd = sd;
              icon->cmd = c;
              icon->changed = EINA_TRUE;
diff --git a/src/efm/efm_custom.c b/src/efm/efm_custom.c
index 19340df..e40f9fb 100644
--- a/src/efm/efm_custom.c
+++ b/src/efm/efm_custom.c
@@ -159,8 +159,8 @@ _icon_custom_data_all_icons_fill(Smart_Data *sd)
      {
         EINA_LIST_FOREACH(block->icons, il, icon)
           {
-             if (icon->geom.x == -9999) continue;
-             if (icon->geom.w == -9999)
+             if (icon->geom.x == INVALID) continue;
+             if (icon->geom.w == INVALID)
                {
                   icon->geom.w = sd->icon_min_w;
                   icon->geom.h = sd->icon_min_h;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to