Skip to content

Commit

Permalink
Revert text rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
laktyushin committed Jul 22, 2023
1 parent 6baa5e1 commit c9133b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion submodules/DrawingUI/Sources/DrawingTextEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit c9133b0

Please sign in to comment.