Skip to content

Commit

Permalink
Some improvements to tooltip placement
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 28, 2017
1 parent 06450e8 commit 819fa75
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions data/gui/window/tooltip_floating.cfg
Expand Up @@ -23,7 +23,7 @@
#define __GUI_WINDOW_FUNCTIONS
def placement_method(m, w, s)
(
if((w.y > s.y) or ((w.x * 2) > s.x)
if((w.y > s.y) or (w.x > s.x)
, 'V'
, if(m.y >= w.y
, if(m.x >= w.x, 'I', 'III')
Expand All @@ -43,7 +43,6 @@ where
placement_method(m, w, s)
, 'I' , m.x - (w.x / 2)
, 'II' , m.x - w.x
, 'III' , 5
# extra offset to avoid being obscured by the mouse. #
, 'IV' , m.x + 15
, 'V' , 5
Expand All @@ -65,9 +64,9 @@ def set_y(m, w, s)
switch(
placement_method(m, w, s)
, 'I' , m.y - (w.y + 5)
, 'II' , 5
, 'II' , m.y
, 'III' , m.y - w.y
, 'IV' , 5
, 'IV' , m.y + 25
, 'V' , 5
, #default# m.y - w.y
)
Expand Down

0 comments on commit 819fa75

Please sign in to comment.