Skip to content

Commit

Permalink
Export Render Scale
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakr233 committed Aug 20, 2024
1 parent 1be1c07 commit 24f9ca3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public struct AnimatedMulticolorGradientViewRepresentable {

public func updatePropertyToView(_ view: AnimatedMulticolorGradientView, initialSetup: Bool) {
view.frameLimit = frameLimit
view.metalLink?.scaleFactor = renderScale
view.renderScale = renderScale

view.setColors(
color,
Expand Down
5 changes: 5 additions & 0 deletions Sources/ColorfulX/AnimatedMulticolorGradientView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ open class AnimatedMulticolorGradientView: MulticolorGradientView {
didSet { renderInputWasModified = true }
}

public var renderScale: Double {
get { metalLink?.scaleFactor ?? 1 }
set { metalLink?.scaleFactor = newValue }
}

// MARK: - FUNCTION

override public init() {
Expand Down

0 comments on commit 24f9ca3

Please sign in to comment.