You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the implementation of InputTextView, the method redrawTextAttachments() is triggered whenever the device orientation changes. This method adjusts the size of NSTextAttachment images:
The logic is designed to resize the images based on the width of the InputTextView. However, there are a few concerns: 1. Why is it necessary to adjust the image size on screen rotation?
Is this behavior tied to a specific use case or requirement? 2. Why does the adjustment result in such a significant size change?
The new width is calculated as frame.width - 2 * (textContainerInset.left + textContainerInset.right), which can sometimes make the images unnaturally large.
Steps to Reproduce
1. Add some images as NSTextAttachment in InputTextView.
2. Rotate the device to a different orientation.
3. Observe that the images are resized and may become too large.
Expected Behavior
• After screen rotation, image sizes should be adjusted reasonably.
• There should be an option to prevent image resizing unless explicitly required.
Questions
• What is the purpose of resizing images upon screen rotation?
• Can we have a configuration option to toggle this resizing behavior?
The text was updated successfully, but these errors were encountered:
style513
changed the title
Issue: Image Size Changes in InputTextView After Screen Rotation
Image Size Changes in InputTextView After Screen Rotation
Dec 11, 2024
Description
In the implementation of InputTextView, the method redrawTextAttachments() is triggered whenever the device orientation changes. This method adjusts the size of NSTextAttachment images:
The logic is designed to resize the images based on the width of the InputTextView. However, there are a few concerns:
1. Why is it necessary to adjust the image size on screen rotation?
Is this behavior tied to a specific use case or requirement?
2. Why does the adjustment result in such a significant size change?
The new width is calculated as frame.width - 2 * (textContainerInset.left + textContainerInset.right), which can sometimes make the images unnaturally large.
Steps to Reproduce
1. Add some images as NSTextAttachment in InputTextView.
2. Rotate the device to a different orientation.
3. Observe that the images are resized and may become too large.
Expected Behavior
• After screen rotation, image sizes should be adjusted reasonably.
• There should be an option to prevent image resizing unless explicitly required.
Questions
• What is the purpose of resizing images upon screen rotation?
• Can we have a configuration option to toggle this resizing behavior?
The text was updated successfully, but these errors were encountered: