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

fix(js/term_buf): fix broken CSS cursor styling 修正壞掉的游標 CSS 樣式設定 #104

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

IepIweidieng
Copy link
Contributor

@IepIweidieng IepIweidieng commented Dec 15, 2021

This PR fixes the issue that the dedicated cursor icons are not used.
此 PR 修正專用的游標圖案沒被用到的問題。

fix(js/term_buf): fix missing ) of url() for CSS cursor style

修正用於 CSS 游標樣式設定的 url() 所少了的 )

The ) was accidentally dropped in the following commit:
這個 ) 在下列 commit 中被不愼移除了:

  • 8d8db1c "feat(term_buf): webpack require cursor urls"

fix(js/term_buf): fix mouseCursor overridden by clearHighlight()

修正 mouseCursorclearHighlight()(的效果)覆蓋的問題

clearHighlight() resets mouseCursor to 0, so clearHighlight() overrides any previous assignments to mouseCursor.
clearHighlight() 會重設 mouseCursor0,因此 clearHighlight() 會覆蓋此前任何賦予 mouseCursor 的値。

clearHighlight() had only been called when there was a highlighted row, but the precondition had complicated the code and was dropped in the following commit:
clearHighlight() 原只在存在被突出顯示的橫行時才會被呼叫,但此前提條件複雜化了程式碼,而在下列 commit 中去除了:

  • b346f46 "Separate more easy reading things.".

To fix this issue, the order of mouseCursor assignment and clearHighlight() is simply swapped.
爲了解決這個問題,對 mouseCursor 的賦値與對 clearHighlight() 的呼叫的順序已交換。

Demostration

The behavior of mouse cursor display after applying this PR:
在套用此 PR 後的滑鼠游標顯示行爲:

PttChrome 2021-12-15 fix-css-cursor demo

Note: For the build in the video, in order to deal with the board-entry screen, I modified App.prototype.onMouse_click() to send the following keys for mouse actions:
注意:在此影片中的程式建構版本中,爲了處理進入看板時的畫面,我修改了 App.prototype.onMouse_click() 來對滑鼠動作送出下列按鍵:\

  • Refresh (clicking the bottom-left corner; 12) 重新整理(按畫面左下角;12): Send Enter End End
  • Last thread (clicking the bottom-right corner; 13) 最後同主題(按畫面右下角;13): Send Enter End End [ ]

Before applying this PR, only the "I" cursor instead of the dedicated cursor icons is used.
在套用此 PR 前,只有 I 字型游標被使用,而專用的游標圖案沒被用到。

The `)` was accidentally dropped in 8d8db1c
"feat(term_buf): webpack require cursor urls".
clearHighlight() resets mouseCursor to 0,
so clearHighlight() overrides any previous assignments to mouseCursor.

clearHighlight() had only been called when there was a highlighted row,
but the precondition had complicated the code
and was dropped in b346f46
"Separate more easy reading things.".

To fix this issue,
the order of mouseCursor assignment and clearHighlight() is simply swapped.
@IepIweidieng IepIweidieng changed the title fix(js/term_buf): fix broken CSS cursor styling fix(js/term_buf): fix broken CSS cursor styling 修正壞掉的游標外觀 CSS 設定 Dec 9, 2022
@IepIweidieng IepIweidieng changed the title fix(js/term_buf): fix broken CSS cursor styling 修正壞掉的游標外觀 CSS 設定 fix(js/term_buf): fix broken CSS cursor styling 修正壞掉的游標 CSS 樣式設定 Dec 9, 2022
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

Successfully merging this pull request may close these issues.

1 participant