featurecat / lizzie

Lizzie - Leela Zero Interface
GNU General Public License v3.0
970 stars 228 forks source link

Fix issues in comment area #879

Open kaorahi opened 3 years ago

kaorahi commented 3 years ago

Issue A:

676 (word wrap). Compared to #696, this PR will be more friendly with the existing code of Lizzie 0.7.4.

(;SZ[19]C[long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line
and
looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong line])

Issue B:

In Panel UI, comments with many lines are scrolled to the bottom initially. The top lines should be visible initially for convenience.

(Try the sample SGF in #877.)

Issue C:

On Lizzie 0.7.4, score 5 is shown in the comment area by the following SGF due to insufficient HTML escaping. It should be score < 5.

(;SZ[19]C[score < 5])

Issue D:

  1. Start Lizzie 0.7.4 with Normal UI (not Panel UI) and paste the following SGF.
  2. Move the mouse cursor to the center of the comment area (the black rectangle at the bottom right)
  3. Move the mouse wheel. Then the comment area is moved upward.
  4. Move the mouse cursor into the main board. Then the comment area returns to the normal position.

I expect nothing happens in the step 3.

(;SZ[19]C[abc])

In addition, this PR may also help future implementation of #806. (only in Panel UI because of #877)

I dare to keep the obsolete name commentPane, that is not JTextPane but JTextArea now. I'd like to make changes as small as possible to avoid conflicts with other patches.