diff options
author | amartin <olpc@localhost.localdomain> | 2007-01-25 03:09:08 (GMT) |
---|---|---|
committer | amartin <olpc@localhost.localdomain> | 2007-01-25 03:09:08 (GMT) |
commit | 02c0a643e64c58f994edd38ef994f0af9fd240fe (patch) | |
tree | 4af2acd98aa45d58839065d1430192646e98943e /SynthLab/SynthLabConstants.py | |
parent | 0701b52b495c7a3aaf62ecc4eab52ca1ddae136f (diff) |
SynthLab mouse overs
Diffstat (limited to 'SynthLab/SynthLabConstants.py')
-rwxr-xr-x | SynthLab/SynthLabConstants.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/SynthLab/SynthLabConstants.py b/SynthLab/SynthLabConstants.py index 23c5b06..ad56d9d 100755 --- a/SynthLab/SynthLabConstants.py +++ b/SynthLab/SynthLabConstants.py @@ -7,23 +7,30 @@ class SynthLabConstants: GT_CONTROL_INPUT = 1 GT_SOUND_OUTPUT = 2 GT_SOUND_INPUT = 3 - # GATE_MAP[objecttype][gatetype][gatenum] = [ sx, sy, ex, ey, (x,y) ] + # GATE_POINT[ojecttype][gatetype][gatenum] = (x,y) + # relative to object center + GATE_POINT = [ [ [ (0,34) ] ], + [ [], [ (-25,-35),(-9,-35),(8,-35),(25,-35) ], [ (0,35) ] ], + [ [], [ (35,-20),(35,-7),(35,7),(35,20) ], [ (0,34) ], [ (0,-34) ] ], + [ [], [], [], [ (0,-35) ] ] ] + # GATE_MAP[objecttype][gatetype][gatenum] = [ sx, sy, ex, ey, (wireX,wireY) ] # gate locations relative to object center GATE_MAP = [ [ [ [-6,28,6,40] ] ], [ [], [[-31,-40,-18,-28], [-16,-40,-3,-28], [2,-40,15,-28], [19,-40,32,-28]], [[-6,28,7,40]] ], [ [], [[28,-26,40,-13], [28,-13,40,0], [28,0,40,13], [28,13,40,26]], [[-6,28,7,40]], [[-6,-40,7,-28]] ], [ [], [], [], [[-6,-40,7,-28]] ] ] - # insert locations into map + # insert wire locations into map + GATE_OFFSET = 7 for oT in GATE_MAP: for gT in oT: for m in gT: x = (m[2]+m[0])//2 y = (m[3]+m[1])//2 # snap to edges - if x < -HALF_SIZE+7: x = -HALF_SIZE - elif x > HALF_SIZE-7: x = HALF_SIZE - if y < -HALF_SIZE+7: y = -HALF_SIZE - elif y > HALF_SIZE-7: y = HALF_SIZE + if x < -HALF_SIZE+GATE_OFFSET: x = -HALF_SIZE + elif x > HALF_SIZE-GATE_OFFSET: x = HALF_SIZE + if y < -HALF_SIZE+GATE_OFFSET: y = -HALF_SIZE + elif y > HALF_SIZE-GATE_OFFSET: y = HALF_SIZE m.append( ( x, y ) ) INIT_LOCATIONS = [ [55,750], [135,750], [215,750], [295, 750], [420,750], [500,750], [580,750], [660, 750], [785,750], [865,750], [945,750], [1025, 750], [540, 645]] |