Skip to content
New issue

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

Fix image didn't fill screen area issue #100

Merged

Conversation

YayunHuang
Copy link
Contributor

@YayunHuang YayunHuang commented Aug 21, 2024

Ref: MUP-153

adjust mask position because we add padding for image in: #79

Screen.Recording.2024-08-21.at.11.02.40.AM.mov

@@ -190,15 +190,16 @@ def create_mockup_image(self, device_path, device_mask_path_prefix, result_path)
tmp = self.target_points[0].copy()
self.target_points[0] = self.target_points[1]
self.target_points[1] = tmp
shifted_points = self.target_points + np.array([PADDING, PADDING])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: How does adding padding and shifting points not affect the pictures fitting the phone?

e.g. if imageA fits perfectly on a phone (say moto-e) before. after adding padding, does imageA still fits perfectly? If so, how?

Thanks~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows why it become incorrect before this update:
image

in #79 we adjusted the position of the pasted image if is_mockup_image_at_front, but forgot to update the other cases

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks yayun! This explanation looks amazing. Can you put it in mockuphone.com/docs? 🙇

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkong-ds add docs to explain why we add padding when generating mockup ~

@YayunHuang YayunHuang force-pushed the mup-153-fix-image-didnt-fill-screen-area branch from 08aa237 to 84dc916 Compare August 21, 2024 09:18
Copy link
Collaborator

@pkong-ds pkong-ds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the great work @YayunHuang 🙏 🙏 🙏

@pkong-ds pkong-ds merged commit 402a924 into oursky:main Aug 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants