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

possible excessive repainting on mouse motion due to errant semicolon #136

Closed
donhatch opened this issue Aug 25, 2020 · 3 comments
Closed

Comments

@donhatch
Copy link
Contributor

OpenSDK javac warns about the semicolon after the "if" clause in MC4DView.java line 264:

        @Override
        public void mouseMoved(MouseEvent me) {
            super.mouseMoved(me);
            if(puzzleManager != null) {
                if(!isInMotion() && puzzleManager.updateStickerHighlighting(me.getX(), me.getY(), getSlicemask(), me.isControlDown()))
                    ;
                repaint();
                return;
            }
        }

It's possible that the semicolon shouldn't be there,
which would mean repaint() is getting called when it shouldn't be
(that is, on every mouse motion, even when the picture isn't changing).

I'm thinking that removing these excessive repaints could greatly improve
interaction/responsiveness, especially on bigger puzzles like the hypermegaminx,
in which every at-rest paint takes 2 seconds due to antialiasing.

donhatch added a commit that referenced this issue Aug 25, 2020
When in debug mode, e.g. "(123 paints)" is shown
in the upper-right corner of the picture.

In my perception, this gives instant clarity on a lot of repaint
and speed issues which were previously elusive.
E.g. it's now very easy to see the effect of keeping or removing
the semicolon that is mentioned in issue #136.
cutelyaware added a commit that referenced this issue Aug 25, 2020
behavior. Will live with it for a while to see if any missing repaint
issues appear before closing the bug report.
@donhatch
Copy link
Contributor Author

Here are some missing repaint issues I have noticed.
These were observable even before Melinda's fix, but the fix makes them often linger longer.

repaint() seems to be missing:

  1. when user changes a color (sky, ground, outlines)
  2. when Help->Debugging is turned on or off

@cutelyaware
Copy link
Owner

OK, I fixed those new repaint cases. Turns out it also allows the users to now see their color adjustments in real-time. Check it out:

  1. Click a color button such as Outlines. (Make sure it's also enabled)
  2. In the color dialog that pops up, select one of the the other tabs such as HSV.
  3. Drag one of the sliders around.

@donhatch
Copy link
Contributor Author

Thanks!

Regarding realtime color adjustment-- that's certainly worlds better, as long as the puzzle is small and/or antialiasing is off.
However, try it in hypermegaminx with "Allow Antialiasing" enabled (which is the default, I believe); it seems pretty painful to me.
See what you think.

donhatch pushed a commit that referenced this issue Sep 30, 2020
…pears to improve"

behavior. Will live with it for a while to see if any missing repaint
issues appear before closing the bug report.

(This cherry picks commit a73e56a
from 'master` into 'melindas_changes_only'.)
donhatch pushed a commit that referenced this issue Oct 1, 2020
…pears to improve"

behavior. Will live with it for a while to see if any missing repaint
issues appear before closing the bug report.

(This cherry picks commit a73e56a
from 'master` into 'melindas_changes_only'.)
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

No branches or pull requests

2 participants