Closed qcgm1978 closed 9 months ago
This may be easier? (on 63eb172e5)
--- a/src/renderer.js
+++ b/src/renderer.js
@@ -411,7 +411,7 @@ const draw_pv = with_opts((...args) => {
showing_branch_p() ? D.draw_goban_with_future_moves(...args) :
already_showing_pv_p() ? draw_another(...args) :
D.draw_goban_with_principal_variation(...args)
-}, ignore_mouse)
+})
const draw_another = (...args) => {
R.different_engine_for_white_p ?
D.draw_goban_with_expected_variation(...args) :
--- a/src/draw_goban.js
+++ b/src/draw_goban.js
@@ -182,7 +182,7 @@ function draw_goban_with_variation(canvas, suggest, opts) {
function draw_goban_with_principal_variation(canvas, options) {
const opt = {draw_endstate_stdev_p: R.show_endstate, ...options}
- draw_readonly_goban_with_variation(canvas, R.suggest[0] || {}, opt)
+ draw_goban_with_variation(canvas, R.suggest[0] || {}, opt)
}
function draw_goban_with_expected_variation(canvas, options) {
I explicitly set the "PV diagram board" read-only in early stage of development when I added the "mouse cursor" on the boards (498b4e6737). I further disabled mouse actions on it later (58f760f60). Though I cannot remember the reasons for them, I'd like to keep it unclickable. The subboard logic is already too complicated. I'm afraid that further actions might exceed my capability to manage, potentially leading to troublesome bugs.
Look at these terrible nested conditionals!
Since I have already changed the suggest moves of the pv diagram to dynamic display in my local code, your method seems to be able to display only the clicked step on the main board, not including the moves before that step. However, you are right, the code should be kept concise.
Currently, there are no mouse events bound to the pv diagram. If you want to study the changes after a step on the pv diagram, you can only start from the first step of the suggest, which is rather cumbersome. I tried it as following code snippet and video:
屏幕录制2023-12-05 20.17.44.webm