Drawing improvements and fixes

This commit is contained in:
Ilya Laktyushin
2020-06-05 17:52:43 +03:00
parent f4f446a708
commit 20a381c595
81 changed files with 1215 additions and 393 deletions

View File

@@ -184,7 +184,7 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f;
{
_style = style;
switch (_style) {
case TGPhotoPaintTextEntityStyleClassic:
case TGPhotoPaintTextEntityStyleRegular:
_textView.layer.shadowColor = [[UIColor blackColor] CGColor];
_textView.layer.shadowOffset = CGSizeMake(0.0f, 4.0f);
_textView.layer.shadowOpacity = 0.4f;
@@ -206,7 +206,7 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f;
- (void)updateColor
{
switch (_style) {
case TGPhotoPaintTextEntityStyleClassic:
case TGPhotoPaintTextEntityStyleRegular:
{
_textView.textColor = _swatch.color;
_textView.strokeColor = nil;
@@ -214,7 +214,7 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f;
}
break;
case TGPhotoPaintTextEntityStyleBorder:
case TGPhotoPaintTextEntityStyleOutlined:
{
_textView.textColor = [UIColor whiteColor];
_textView.strokeColor = _swatch.color;
@@ -222,7 +222,7 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f;
}
break;
case TGPhotoPaintTextEntityStyleFrame:
case TGPhotoPaintTextEntityStyleFramed:
{
CGFloat lightness = 0.0f;
CGFloat r = 0.0f;
@@ -646,8 +646,6 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f;
if (i == 0) {
last = cur;
} else if (i > 0 && fabs(CGRectGetMaxY(last) - CGRectGetMinY(cur)) < 10.0) {
NSValue *lastValue = [self.rectArray objectAtIndex:i-1];
last = lastValue.CGRectValue;
CGPoint a = cur.origin;
CGPoint b = CGPointMake(CGRectGetMaxX(cur), cur.origin.y);
CGPoint c = CGPointMake(last.origin.x, CGRectGetMaxY(last));
@@ -690,6 +688,8 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f;
[addPath addLineToPoint:CGPointMake(d.x + _radius, d.y)];
[self.path appendPath:addPath];
}
last = cur;
}
}
[self.path fill];