Changeset 1700

Show
Ignore:
Timestamp:
07/21/07 08:18:12 (1 year ago)
Author:
wrobe..@pld-linux.org
Message:

- distribute rotated boxes nicely

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/demo_profile.py

    r1670 r1700  
    168168    bb.matrix.rotate(math.pi/4.) 
    169169    c.add(bb, parent=b) 
     170    n = math.floor(count ** 0.5) 
    170171    for i in xrange(count): 
    171172        bb=Box() 
    172173        print 'box', bb 
     174        x = int(i % n) * 20 
     175        y = int(i / n) * 20 
     176        bb.matrix.translate(x, y) 
    173177        bb.matrix.rotate(math.pi/4.0 * i / 10.0) 
    174178        c.add(bb, parent=b) 
     
    179183        x = int(i % 4) * 20 
    180184        y = int(i / 4) * 20 
    181         bb.matrix.translate(5 + x, 100 + y) 
     185        bb.matrix.translate(20 + x, 100 + y) 
    182186        c.add(bb) 
    183187