We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List_Implementation Branch
When adding a photo - it should be resized to fit frame ( and handle orientation changes )
Eitehr that, or a small placeholder should be pasted in, and upon touching a modal full size one is show (again, working in both orientations.)
The text was updated successfully, but these errors were encountered:
This isn't FULLY working - it's working for Landscape, but not Portrait properly - and doesn't dynamically adjust previously saved photos..
But this is changes to your RichTextEditor.m
( void ) richTextEditorToolbarDidSelectTextAttachment:( UIImage * )textAttachment { UIViewController * parentView = nil; CGFloat textWindowWidth = 0.0f;
if ( self.delegate != nil ) { parentView = (UIViewController * )self.delegate; }
if ( UIInterfaceOrientationIsPortrait( parentView.interfaceOrientation ) ) { textWindowWidth = self.frame.size.height; } else if ( UIInterfaceOrientationIsLandscape( parentView.interfaceOrientation ) ) { textWindowWidth = self.frame.size.width; }
CGSize currentSize = textAttachment.size;
CGFloat biggestDimension = 0.0f;
if ( currentSize.width > currentSize.height ) { biggestDimension = currentSize.width; } else { biggestDimension = currentSize.height; }
CGFloat resizeRatio = 0.0f;
if ( biggestDimension > textWindowWidth ) { resizeRatio = textWindowWidth / biggestDimension; } else { resizeRatio = 1.0f; }
CGSize newSize = CGSizeMake( currentSize.width * resizeRatio, currentSize.height * resizeRatio );
textAttachment = [self imageWithImage:textAttachment scaledToSize:newSize];
NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; [attachment setImage:textAttachment]; NSAttributedString *attributedStringAttachment = [NSAttributedString attributedStringWithAttachment:attachment];
NSMutableAttributedString *attributedString = [self.attributedText mutableCopy]; [attributedString insertAttributedString:attributedStringAttachment atIndex:self.selectedRange.location]; self.attributedText = attributedString; }
( UIImage * ) imageWithImage:( UIImage * )image scaledToSize:( CGSize )newSize { UIGraphicsBeginImageContextWithOptions( newSize, NO, 0.0f );
[image drawInRect:CGRectMake( 0.0f, 0.0f, newSize.width, newSize.height )];
UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage; }
Sorry, something went wrong.
No branches or pull requests
List_Implementation Branch
When adding a photo - it should be resized to fit frame ( and handle orientation changes )
Eitehr that, or a small placeholder should be pasted in, and upon touching a modal full size one is show (again, working in both orientations.)
The text was updated successfully, but these errors were encountered: