misohena / el-easydraw

Embedded drawing tool for Emacs
https://misohena.jp/blog/2021-09-21-emacs-easy-draw.html
GNU General Public License v3.0
721 stars 21 forks source link

Click position offset #8

Closed markgdawson closed 1 year ago

markgdawson commented 2 years ago

The click position seems to be interpreted as slightly to the right of the position of point.

I need to click further just to the left of any buttons or controls to use them. Also, when I click on the panel on the left hand side, the circle denoting the colour is offset to the right of the mouse.

It looks to me as if all the mouse clicks are interpreted as being slightly offset.

misohena commented 2 years ago

問題の起きる状況についていくつか私に教えて頂けないでしょうか。

問題が起きるのはどのコマンドを実行したときでしょうか。恐らく問題が起きたのはあなたがカラーピッカーを使用したときだと思います。あなたが使用したのは edraw-color-picker-read-color でしょうか、それとも edraw-color-picker-insert-coloredraw-color-picker-replace-color-at-point でしょうか。

また、それらのコマンドの間で位置のずれ方(オフセット)に違いはあるでしょうか。

edraw-color-picker-insert-colorやedraw-color-picker-replace-color-at-pointを使用した場合、カラーピッカーが表示される場所は現在のポイントの位置によって変化します。特にカラーピッカーの水平位置はポイントのカラム位置によって変化します。カラーピッカーが表示される場所によってずれ方(オフセット)は変化するでしょうか。

私は以前別のプロジェクトでこれと似たような問題を見たことがあります。 (https://github.com/misohena/el-igo/issues/1 )

その時の調査によれば、line-prefixテキストプロパティが使用されているとマウスイベントの座標がずれることが分かっています。例えばorg-modeにおいて org-indent-mode(または #+STARTUP: indent)を使用すると行頭に画像があるときにクリック位置がずれることが分かっています。この問題の解決方法はまだ分かっていません。

(Google Translate): Let me confirm a few things about the problem.

Which command does the problem occur? Perhaps the problem occurred when you used the color picker. Did you use edraw-color-picker-read-color , or edraw-color-picker-insert-color or edraw-color-picker-replace-color-at-point ? .

Also, is there a difference in the position shift (offset) between those commands?

When using edraw-color-picker-insert-color or edraw-color-picker-replace-color-at-point, the location where the color picker is displayed depends on the current point position. In particular, the horizontal position of the color picker changes depending on the column position of the point. Does the offset change depending on where the color picker is displayed?

I've seen a similar problem in another project before. (https://github.com/misohena/el-igo/issues/1 )

Investigations at that time showed that the coordinates of the mouse event were misaligned when the line-prefix text property was used. For example, using org-indent-mode (or #+STARTUP: indent ) in org-mode has been found to shift the click position when there is an image at the beginning of the line. The solution to this problem is not yet known.

misohena commented 1 year ago

状況がよく分からず返答も無いのでクローズします。

Emacsにはマウス座標がずれるバグがいくつか見つかっています。気になるようならEmacsにバグ報告して下さい。

(Google Translate): I don't understand the situation well and there is no reply, so I will close it.

Some bugs have been found in Emacs that cause mouse coordinates to shift. Please report bugs to Emacs if you are concerned.