Skip to content

Fix floatcanvas Text.ShiftFunDict: convert float to int - #2749

Merged
swt2c merged 1 commit into
wxWidgets:masterfrom
komoto48g:fix-floatcanvas
May 6, 2025
Merged

Fix floatcanvas Text.ShiftFunDict: convert float to int#2749
swt2c merged 1 commit into
wxWidgets:masterfrom
komoto48g:fix-floatcanvas

Conversation

@komoto48g

Copy link
Copy Markdown
Contributor

Fixes #2748

This PR modifies "wx/lib/floatcanvas/FCObjects.py" and is part of #2448, which currently has conflicts.

@swt2c
swt2c merged commit 73ff2a8 into wxWidgets:master May 6, 2025
@komoto48g

Copy link
Copy Markdown
Contributor Author

Sorry, I hadn't checked the bitmap drawing test. I've confirmed that the bitmap position is also incorrect.
But I just pushed one more commit—could you revert or reopen this? Sorry for the inconvenience.

@swt2c

swt2c commented May 6, 2025

Copy link
Copy Markdown
Collaborator

Can't - you'll have to open a new PR.

@komoto48g

Copy link
Copy Markdown
Contributor Author

Ok, I will!

@urishab

urishab commented May 6, 2025

Copy link
Copy Markdown
Contributor

I’m not sure this fix is gonna cut it.
The // operator no longer converts to int.
it just gives the floor of the number but can return float.
so I think you’re going to have to explicitly convert to int to satisfy all cases.

@komoto48g

Copy link
Copy Markdown
Contributor Author

I can see that, but it doesn't cover all cases. I also tested the Allow and AllowLine cases and confirmed that they have issues as well. The issue comes from passing a float value to dc.DrawXXX.
I will check some more and submit a PR later and would appreciate it if you could review it.

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.

FLoatCanvas Bitmap & Text always get drawn at (0,0) under Python 3.11

3 participants