From c9133b0830de500ea828b34abc5f65362d20ee0e Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sat, 22 Jul 2023 15:00:35 +0200 Subject: [PATCH] Revert text rendering --- submodules/DrawingUI/Sources/DrawingTextEntity.swift | 2 +- .../MediaEditor/Sources/MediaEditorComposerEntity.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/submodules/DrawingUI/Sources/DrawingTextEntity.swift b/submodules/DrawingUI/Sources/DrawingTextEntity.swift index c7be445f5e6..08d69a7d983 100644 --- a/submodules/DrawingUI/Sources/DrawingTextEntity.swift +++ b/submodules/DrawingUI/Sources/DrawingTextEntity.swift @@ -693,7 +693,7 @@ public final class DrawingTextEntityView: DrawingEntityView, UITextViewDelegate func getRenderImage() -> UIImage? { let rect = self.bounds - UIGraphicsBeginImageContextWithOptions(rect.size, false, 3.0) + UIGraphicsBeginImageContextWithOptions(rect.size, false, 2.0) self.textView.drawHierarchy(in: rect, afterScreenUpdates: true) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() diff --git a/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorComposerEntity.swift b/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorComposerEntity.swift index c3bfbb5601e..78acc111cc4 100644 --- a/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorComposerEntity.swift +++ b/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorComposerEntity.swift @@ -69,9 +69,9 @@ func composerEntitiesForDrawingEntity(account: Account, entity: DrawingEntity, c return [MediaEditorComposerStaticEntity(image: image, position: CGPoint(x: entity.drawingSize.width * 0.5, y: entity.drawingSize.height * 0.5), scale: 1.0, rotation: 0.0, baseSize: entity.drawingSize, baseScale: nil, mirrored: false)] } else if let entity = entity as? DrawingTextEntity { var entities: [MediaEditorComposerEntity] = [] - entities.append(prerenderTextTransformations(entity: entity, image: renderImage, colorSpace: colorSpace)) +// entities.append(prerenderTextTransformations(entity: entity, image: renderImage, colorSpace: colorSpace)) -// entities.append(MediaEditorComposerStaticEntity(image: image, position: entity.position, scale: entity.scale, rotation: entity.rotation, baseSize: nil, baseScale: 0.333, mirrored: false)) + entities.append(MediaEditorComposerStaticEntity(image: image, position: entity.position, scale: entity.scale, rotation: entity.rotation, baseSize: nil, baseScale: 0.5, mirrored: false)) if let renderSubEntities = entity.renderSubEntities { for subEntity in renderSubEntities { entities.append(contentsOf: composerEntitiesForDrawingEntity(account: account, entity: subEntity, colorSpace: colorSpace, tintColor: entity.color.toUIColor()))