question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Horizontal ScrollPanes done borked

See original GitHub issue

Line 438 in recent Snapshot of ScrollPane:

hScrollBounds.set(x, y, widgetArea.width, scrollbarWidth);

Should be scrollbarHeight, tested it with a duplicated class and fixed the problem. Right now the bounds height is 0 so no visual bar / not clickable.

PS It’d be neat if LibGDX (scene2D) classes didn’t have so many package-protected members to make simple modifications through anonymous inner classes easier 😕

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
obigucommented, Sep 20, 2020

@NathanSweet Suggestion is to make fields and methods protected, not public. This way, subclasses can access or override. It is asked regularly.

I guess @MrStahlfelge you meant private instead of public hence the misunderstanding.

In my personal experience I’ve found some limitations when trying to create my own widgets by extending Scene2D classes, not that much because of private modifiers but because of default/package modifiers. Within the com.badlogic.gdx.scenes.scene2d.ui there’s quite some room for extensibility but it gets more limited outside it. To overcome this limitations I’ve had to create a com.badlogic.gdx.scenes.scene2d.ui package in some of my apps just to be able to extend some widgets without copying the whole thing (ScrollPane is an example).

0reactions
NathanSweetcommented, Sep 23, 2020

The existance of the issue and the change just proves the point that there are a lot of package-private or private fields and methods that should be protected or public.

The issue is that a getter was missing, not that everything should be public.

I don’t see anything beingprotected as public. I don’t think that changing protected stuff is API breakage.

Protected members appear in the public API, users are free to use them at will and without expecting breakage. FWIW see Effective Java by Joshua Bloch or his talks on API design. Not that it’s a bible, just that I’m not inventing things.

This scenario isn’t specific to scene2d, every library faces this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TablePanel: Horizontal scrolling broken in v8.5 beta #47672
What happened: My table have a lot of columns, and when i scroll horizontal, it's only show header, not show value.
Read more >
How to find the cause of horizontal scrollbars - Polypane
When Polypane detects a pane that has a horizontal scrollbar, it automatically highlights elements that cause the overflow. See this video for ...
Read more >
PLEASE HELP - Excel Horizontal Scroll Not Working
Hello all: I have an excel workbook that is many columns wide. I am on a Macbook Pro, Office 365. Scroll lock is...
Read more >
[Fixed!] Excel Horizontal Scroll Bar Not Working (8 Possible ...
First, in the View tab, select the drop-down arrow of the Freeze Panes option from the Window group. Now, click on the Unfreeze...
Read more >
disable horizontal scroll in jscrollpane - java - Stack Overflow
I have a JScrollPane with FlowLayout that I want to have a fixed width. It should be scrolling vertically only, and the contents...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found