Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There seems to be an error in
ImageDrawRectangleRec
where we should subtract the absolute values ofrec.x
andrec.y
fromrec.width
andrec.height
when they are negative.Currently, we are subtracting the negative values, which is equivalent to addition. For example, in the current implementation:
![GIF1](https://private-user-images.githubusercontent.com/90587919/295662311-e852af23-7f79-4979-8a1c-68bb3ea0fd1b.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDU4MTcsIm5iZiI6MTczOTI0NTUxNywicGF0aCI6Ii85MDU4NzkxOS8yOTU2NjIzMTEtZTg1MmFmMjMtN2Y3OS00OTc5LThhMWMtNjhiYjNlYTBmZDFiLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAzNDUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyODI0ZDk4NDRmYjg1ZWZjZDhkMDliMzViYWMwOGFiNWMxNTJhYjEyNTgxNGQ5NTQxYWVjZjQ0MzExMTQzYzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JPU-rgGVFPNn_C5SFWYhAExLuaJOTOSDdTWN4o8t3Ks)
If we replace
![GIF2](https://private-user-images.githubusercontent.com/90587919/295662361-fcdcd1ca-ba67-4168-b764-1510869b207a.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDU4MTcsIm5iZiI6MTczOTI0NTUxNywicGF0aCI6Ii85MDU4NzkxOS8yOTU2NjIzNjEtZmNkY2QxY2EtYmE2Ny00MTY4LWI3NjQtMTUxMDg2OWIyMDdhLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAzNDUxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5ZjAxOTFkZTUwODYwOTRkOWNlOTY0ZjU4MGNjNDU4YWEwNWNjOTJkNjI5ZDU2ZWJlODJhNzgyMmNlODEyYTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Lh5nLc26l855zuhJIjjiqj1x8HoVhY_EbIY0KqQE9PI)
size -= position
withsize += position
, considering that the position is negative, we correctly subtract the difference as desired. This results (the visual glitches are from my screen recorder):