#NEWLINE# def __init__( self , packer , blocks ) : #NEWLINE# #INDENT# self . packer = packer #NEWLINE# self . width = packer . root . w #NEWLINE# self . height = packer . root . h #NEWLINE# self . blocks = blocks #NEWLINE# self . area = ( self . width * self . height ) #NEWLINE# self . usedArea = sum ( [ ( s . w * s . h ) for s in blocks ] ) #NEWLINE# self . used = ( ( 100 / s . area ) * self . usedArea )