mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Drawing improvements
This commit is contained in:
@@ -27,6 +27,26 @@ enum DrawingTextStyle: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
enum DrawingTextAnimation: Equatable {
|
||||
case none
|
||||
case typing
|
||||
case wiggle
|
||||
case zoomIn
|
||||
|
||||
init(animation: DrawingTextEntity.Animation) {
|
||||
switch animation {
|
||||
case .none:
|
||||
self = .none
|
||||
case .typing:
|
||||
self = .typing
|
||||
case .wiggle:
|
||||
self = .wiggle
|
||||
case .zoomIn:
|
||||
self = .zoomIn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum DrawingTextAlignment: Equatable {
|
||||
case left
|
||||
case center
|
||||
@@ -266,6 +286,7 @@ final class TextFontComponent: Component {
|
||||
final class TextSettingsComponent: CombinedComponent {
|
||||
let color: DrawingColor?
|
||||
let style: DrawingTextStyle
|
||||
let animation: DrawingTextAnimation
|
||||
let alignment: DrawingTextAlignment
|
||||
let font: DrawingTextFont
|
||||
let isEmojiKeyboard: Bool
|
||||
@@ -277,6 +298,7 @@ final class TextSettingsComponent: CombinedComponent {
|
||||
let updateFastColorPickerPan: (CGPoint) -> Void
|
||||
let dismissFastColorPicker: () -> Void
|
||||
let toggleStyle: () -> Void
|
||||
let toggleAnimation: () -> Void
|
||||
let toggleAlignment: () -> Void
|
||||
let presentFontPicker: () -> Void
|
||||
let toggleKeyboard: (() -> Void)?
|
||||
@@ -284,6 +306,7 @@ final class TextSettingsComponent: CombinedComponent {
|
||||
init(
|
||||
color: DrawingColor?,
|
||||
style: DrawingTextStyle,
|
||||
animation: DrawingTextAnimation,
|
||||
alignment: DrawingTextAlignment,
|
||||
font: DrawingTextFont,
|
||||
isEmojiKeyboard: Bool,
|
||||
@@ -294,12 +317,14 @@ final class TextSettingsComponent: CombinedComponent {
|
||||
updateFastColorPickerPan: @escaping (CGPoint) -> Void = { _ in },
|
||||
dismissFastColorPicker: @escaping () -> Void = {},
|
||||
toggleStyle: @escaping () -> Void,
|
||||
toggleAnimation: @escaping () -> Void,
|
||||
toggleAlignment: @escaping () -> Void,
|
||||
presentFontPicker: @escaping () -> Void,
|
||||
toggleKeyboard: (() -> Void)?
|
||||
) {
|
||||
self.color = color
|
||||
self.style = style
|
||||
self.animation = animation
|
||||
self.alignment = alignment
|
||||
self.font = font
|
||||
self.isEmojiKeyboard = isEmojiKeyboard
|
||||
@@ -310,6 +335,7 @@ final class TextSettingsComponent: CombinedComponent {
|
||||
self.updateFastColorPickerPan = updateFastColorPickerPan
|
||||
self.dismissFastColorPicker = dismissFastColorPicker
|
||||
self.toggleStyle = toggleStyle
|
||||
self.toggleAnimation = toggleAnimation
|
||||
self.toggleAlignment = toggleAlignment
|
||||
self.presentFontPicker = presentFontPicker
|
||||
self.toggleKeyboard = toggleKeyboard
|
||||
@@ -322,6 +348,9 @@ final class TextSettingsComponent: CombinedComponent {
|
||||
if lhs.style != rhs.style {
|
||||
return false
|
||||
}
|
||||
if lhs.animation != rhs.animation {
|
||||
return false
|
||||
}
|
||||
if lhs.alignment != rhs.alignment {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user