Cell Selection Rectangle Drifts Left Of Center

22 views
Skip to first unread message

Michael Greco

unread,
May 5, 2025, 5:17:35 AMMay 5
to ControlsFX
        <java.version>21</java.version>
        <javafx.version>23</javafx.version>

I'm new to JavaFx and of course ControlsFX, so I'm sure I'm doing something wrong, but I tried to create a listener that would expand the grid when the cursor reached the end of current grid size, expands both in columns and rows.  What I have so far works, but the visual focus rectangle seems to be drifting left as I move further to the right.  The drift doesn't occur when I expand rows, it only happens expanding columns.  It almost looks like this happens a little bit even before I expand columns as well.  Here's a short video of what I'm doing for a visual.  Any thoughts on this, or do I need to recalculate the current cell's position/boundaries and redraw this everytime?

Thanks
Mike
CursorFocusDriftsLeft.mp4

David Williams

unread,
May 5, 2025, 11:46:36 PMMay 5
to ControlsFX
Are you drawing the focus rectangle yourself?  It seems like it's just drifting a pixel or two each time you add the column.  If so, I'd recommend not drawing it yourself, and just setting the border color in CSS for the table cells in that table.

--Dave

Michael Greco

unread,
May 6, 2025, 11:05:59 PMMay 6
to ControlsFX
I wish I was drawing it myself, but no.  I'm not sure where its being generated from, but for kicks I just created my initial grid extra wide (30 cells) and without hitting my custom logic to expand the columns, it still drifts.

David Williams

unread,
May 7, 2025, 9:17:15 PMMay 7
to ControlsFX
Please, post a link to your code if you can.

Michael Greco

unread,
May 8, 2025, 7:24:03 PMMay 8
to ControlsFX
My messages aren't posting for some reason or I'm just not doing this right.  I figured out that my display was to 125%, I changed it to 100% and it worked fine after that.

Michael Greco

unread,
May 8, 2025, 7:24:03 PMMay 8
to ControlsFX
I think I just solved it... my display scale was set to 125%, and I changed it to 100% and it fixed it.  So that's probably not good but maybe that would help get to the solution for this?

Michael Greco

unread,
May 8, 2025, 7:24:03 PMMay 8
to ControlsFX
David, sorry I thought i posted earlier but it must have not worked.  I determine was because my display scale was set to 125%.  When I set it to 100% it worked fine.

On Wednesday, May 7, 2025 at 9:17:15 PM UTC-4 david.bradl...@gmail.com wrote:

David Williams

unread,
May 8, 2025, 11:43:35 PMMay 8
to ControlsFX
I have run into rendering issues on linux where popup dialogs and tooltips don''t get placed correctly because of display scale and simiilar settings.  This must be another one of those.
Reply all
Reply to author
Forward
0 new messages