<commit_before>//
//  SelectionView.swift
//  Waveform
//
//  Created by developer on 26/01/16.
//  Copyright © 2016 developer. All rights reserved.
//

import UIKit

class SelectionView: UIView {
    
    var selectionLayer: CALayer!
    init() {
        super.init(frame: .zero)
        self.setup()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.setup()
    }
    
    func setup() {
        self.setupSelectionLayer()
        self.backgroundColor = .clearColor()
    }
    
    func setupSelectionLayer() {
        let layer             = CALayer()
        layer.borderColor     = UIColor.grayColor().CGColor
        layer.cornerRadius    = 5.0
        layer.borderWidth     = 2.0
        layer.backgroundColor = UIColor.clearColor().CGColor
        self.layer.addSublayer(layer)
        self.selectionLayer   = layer
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.layoutSelection(self.selection)<commit_msg>[fix] Make selection be clipped by bounds<commit_after>//
//  SelectionView.swift
//  Waveform
//
//  Created by developer on 26/01/16.
//  Copyright © 2016 developer. All rights reserved.
//

import UIKit

class SelectionView: UIView {
    
    var selectionLayer: CALayer!
    init() {
        super.init(frame: .zero)
        self.setup()
        self.clipsToBounds = true
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.setup()
        self.clipsToBounds = true
    }
    
    func setup() {
        self.setupSelectionLayer()
        self.backgroundColor = .clearColor()
    }
    
    func setupSelectionLayer() {
        let layer             = CALayer()
        layer.borderColor     = UIColor.grayColor().CGColor
        layer.cornerRadius    = 5.0
        layer.borderWidth     = 2.0
        layer.backgroundColor = UIColor.clearColor().CGColor
        self.layer.addSublayer(layer)
        self.selectionLayer   = layer
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.layoutSelection(self.selection)
{'fraction_non_alphanumeric': 0.10244360902255639, 'fraction_numerical': 0.013157894736842105, 'mean_word_length': 1.9776223776223776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7647879', 'n_tokens_mistral': 648, 'n_tokens_neox': 623, 'n_words': 129}