             maximumPower = max + levelOffset
         }
         var groups: LevelGroup[] = []
-        if totalLevels < Int(self.bounds.size.width) {
+        if totalLevels < Int(bounds.size.width) {
             for audioLevel in audioLevels {
                 let group = LevelGroup(levels: [audioLevel])
                 groups.append(group)
             }
             optimumWidth = totalLevels
         } else {
-            optimumWidth = Int(self.bounds.size.width)
+            optimumWidth = Int(bounds.size.width)
             while (totalLevels % optimumWidth == 0) {
                 --optimumWidth
             }

//

import Cocoa

class EditorView: NSView {
    

    var optimumWidth: Int = 0
    var levelGroups: LevelGroup[] = []
    var levelOffset: Float = 0
    var trimView: NSView?
    
    // MARK: properties
    var audioLevels: Float[] = [] {
