Skip to content

Commit 50fad39

Browse files
committed
v241230.1
1 parent b32305e commit 50fad39

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed
22 Bytes
Binary file not shown.

dist/easycoder-241230.1.tar.gz

26 Bytes
Binary file not shown.

easycoder/ec_renderer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def addElement(self, id, spec):
7878
self.zlist.append(element)
7979

8080
def createElement(self, spec):
81-
def recalc(val):
81+
# Get a real position or size value
82+
def getReal(val):
8283
if isinstance(val, str):
8384
c = val[-1]
8485
if c in ['w', 'h']:
@@ -105,9 +106,9 @@ def recalc(val):
105106
Color(c[0], c[1], c[2])
106107
else:
107108
Color(c[0]/255, c[1]/255, c[2]/255)
108-
pos = (recalc(spec.pos[0]), recalc(spec.pos[1]))
109+
pos = (getReal(spec.pos[0]), getReal(spec.pos[1]))
109110
spec.realpos = pos
110-
size = (recalc(spec.size[0]), recalc(spec.size[1]))
111+
size = (getReal(spec.size[0]), getReal(spec.size[1]))
111112
spec.realsize = size
112113
if spec.parent != None:
113114
pos = Vector(pos) + spec.parent.realpos

json/graphics-demo.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464

6565
"Photo": {
6666
"type": "image",
67-
"left": 70,
68-
"bottom": 150,
69-
"width": 500,
70-
"height": 300,
67+
"left": "10w",
68+
"bottom": "30h",
69+
"width": "80w",
70+
"height": "60h",
7171
"source": "images/Semoigo Dawn.jpg",
7272
"id": "dawn"
7373
}

0 commit comments

Comments
 (0)