diff --git a/submodules/DrawingUI/Sources/DrawingTextEntity.swift b/submodules/DrawingUI/Sources/DrawingTextEntity.swift index 66ce1c60a3..5ef8e8b946 100644 --- a/submodules/DrawingUI/Sources/DrawingTextEntity.swift +++ b/submodules/DrawingUI/Sources/DrawingTextEntity.swift @@ -697,6 +697,8 @@ final class DrawingTextEntityView: DrawingEntityView, UITextViewDelegate { func getRenderSubEntities() -> [DrawingStickerEntity] { let textSize = self.textView.bounds.size let textPosition = self.textEntity.position + let scale = self.textEntity.scale + let rotation = self.textEntity.rotation let itemSize: CGFloat = floor(24.0 * self.displayFontSize * 0.8 / 17.0) @@ -709,10 +711,12 @@ final class DrawingTextEntityView: DrawingEntityView, UITextViewDelegate { let entity = DrawingStickerEntity(file: file) entity.referenceDrawingSize = CGSize(width: itemSize * 2.5, height: itemSize * 2.5) - entity.scale = self.textEntity.scale - entity.position = textPosition.offsetBy(dx: emojiTextPosition.x, dy: emojiTextPosition.y) - entity.rotation = self.textEntity.rotation - + entity.scale = scale + entity.position = textPosition.offsetBy( + dx: (emojiTextPosition.x * cos(rotation) + emojiTextPosition.y * sin(rotation)) * scale, + dy: (emojiTextPosition.y * cos(rotation) + emojiTextPosition.x * sin(rotation)) * scale + ) + entity.rotation = rotation entities.append(entity) } return entities diff --git a/submodules/DrawingUI/Sources/PenTool.swift b/submodules/DrawingUI/Sources/PenTool.swift index 5c26fa7e2d..1537d2d177 100644 --- a/submodules/DrawingUI/Sources/PenTool.swift +++ b/submodules/DrawingUI/Sources/PenTool.swift @@ -123,7 +123,7 @@ final class PenTool: DrawingElement { self.renderLineWidth = lineWidth self.renderArrowLength = lineWidth * 3.0 - self.renderArrowLineWidth = lineWidth + self.renderArrowLineWidth = lineWidth * 0.8 self.renderLine = StrokeLine(color: color.toUIColor(), minLineWidth: minLineWidth + (lineWidth - minLineWidth) * 0.3, lineWidth: lineWidth) } @@ -162,10 +162,6 @@ final class PenTool: DrawingElement { if let previousPoint, point.location.distance(to: previousPoint) < filterDistance, state == .changed, self.renderLine.ready { return } - print("vel: \(point.velocity)") - if let previousPoint { - print("dist: \(point.location.distance(to: previousPoint))") - } self.previousPoint = point.location let rect = self.renderLine.draw(at: point)