# CutBox.app

## Coverage Report

#### Created: 2024-03-12 03:40

    .../Source/App/Preferences/PreferencesService/CutBoxPreferences+TextScaling.swift

    Line

    Count

    Source (jump to first uncovered line)

    1

    //

    2

    //  CutBoxPreferences+TextScaling.swift

    3

    //  CutBox

    4

    //

    5

    //  Created by Jason Milkins on 24/9/22.

    6

    //  Copyright © 2018-2023 ocodo. All rights reserved.

    7

    //

    8

    9

    import Foundation

    10

    import Cocoa

    11

    12

    extension CutBoxPreferencesService {

    13

    14

    1

        func scaleTextDown() {

    15

    1

            if let itemSize = self.searchViewClipTextFieldFont?.pointSize,

    16

    1

                let previewSize = self.searchViewClipPreviewFont?.pointSize {

    17

    1

                if itemSize > minItemSize {

    18

    1

                    self.searchViewClipTextFieldFont = NSFont(name: "Helvetica Neue", size: itemSize - 1)

    19

    1

                }

    20

    1

    21

    1

                if previewSize > minPreviewSize {

    22

    1

                    self.searchViewClipPreviewFont = NSFont(name: "Menlo", size: previewSize - 1)

    23

    1

                }

    24

    1

            } else {

    25

    0

                fatalError("ScaleTextDown get font size error")

    26

    1

            }

    27

    1

        }

    28

    29

    1

        func scaleTextUp() {

    30

    1

            if let itemSize = self.searchViewClipTextFieldFont?.pointSize,

    31

    1

                let previewSize = self.searchViewClipPreviewFont?.pointSize {

    32

    1

                if itemSize < maxItemSize {

    33

    1

                    self.searchViewClipTextFieldFont = NSFont(name: "Helvetica Neue", size: itemSize + 1.0)

    34

    1

                }

    35

    1

    36

    1

                if previewSize < maxPreviewSize {

    37

    1

                    self.searchViewClipPreviewFont = NSFont(name: "Menlo", size: previewSize + 1.0)

    38

    1

                }

    39

    1

            } else {

    40

    0

                fatalError("ScaleTextUp get font size error")

    41

    1

            }

    42

    1

        }

    43

    44

    1

        func scaleTextNormalize() {

    45

    1

            self.searchViewClipPreviewFont = NSFont(name: "Menlo", size: 12.0)

    46

    1

            self.searchViewClipTextFieldFont = NSFont(name: "Helvetica Neue", size: 12.0)

    47

    1

        }

    48

    }