[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG] overlay 'line-height property is invalid when window width change
From: |
stardiviner |
Subject: |
[BUG] overlay 'line-height property is invalid when window width change |
Date: |
Mon, 04 May 2020 07:43:31 +0800 |
User-agent: |
mu4e 1.4; emacs 28.0.50 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Here is one post contains screenshots shows what problem I got:
https://emacs-china.org/t/org-agenda/8679/26?u=stardiviner
I tried many ways to debug this issue.
- - [X] Edebug my bellowing source code, it works fine.
- - [X] bug-hunter-init-file on my Emacs config, have not found config caused
this problem.
- - [X] I also tried an Emacs Minimal Config to testing bellowing source code.
Still have this problem too.
- - [X] I'm currently using the latest master branch compiled version Emacs
GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.17, cairo
version 1.17.3) of 2020-05-03
- - [X] I tried to compile a version of Emacs which commit is two months ago,
still have this problem too.
- - [X] The last place is Emacs core function, it's the last place I have not
test, and I don't have that ability.
==============================================================================
Here is the source code of colorizing block in org-agenda:
#+begin_src emacs-lisp
(defun org-agenda-log-mode-colorize-block ()
"Set different line spacing based on clock time duration."
(save-excursion
(let* ((colors (cl-case (alist-get 'background-mode (frame-parameters))
('light
(list "#F6B1C3" "#FFFF9D" "#BEEB9F"
"#ADD5F7"))
('dark
(list "#aa557f" "DarkGreen" "DarkSlateGray"
"DarkSlateBlue"))))
pos
duration)
(nconc colors colors)
(goto-char (point-min))
(while (setq pos (next-single-property-change (point) 'duration))
(goto-char pos)
(when (and (not (equal pos (point-at-eol)))
(setq duration (org-get-at-bol 'duration)))
;; larger duration bar height
;; FIXME (< duration 15)
(let ((line-height (if (< duration 15) 1.0 (+ 0.5 (/ duration 30))))
(ov (make-overlay (point-at-bol) (1+ (point-at-eol)))))
(overlay-put ov 'face `(:background ,(car colors) :foreground
"black"))
(setq colors (cdr colors))
(overlay-put ov 'line-height line-height)
(overlay-put ov 'line-spacing (1- line-height))))))))
(add-hook 'org-agenda-finalize-hook #'org-agenda-log-mode-colorize-block)
#+end_src
- --
[ stardiviner ]
I try to make every word tell the meaning that I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-----BEGIN PGP SIGNATURE-----
iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl6vVyMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMeqwgAuv/OINDsQeUoc5+Mn5DoDMUsG4T4
rmDHbLsNfp19RpvdHxTDdqAGxjwskv1fV1UP2+YL9VFtOWmnrGsscfWnycceJvBc
rJAQ7xaB13RRkWn5hNvlV5ulaRSIvEOe1uRMnX1VemrseTKyjaCrhqIsbPrsDWrS
GtjfGX6L6kJy0e1AnI01/jp8BUpXWi+3/9jEbOHdz2ejxN/ObJSXjqBydWDfPYUW
BzSrzB6U5oeLtpbOtqLw/0WzgDKO+pYq8bK56Sb5qvxEf3wq10nJZXW4WqFayLjw
d+vzUeMk1JFgKBo9VpFVOeo67zdtwl4cn4BkCulNYvKmU1i/DH3XCn3vyw==
=DG3+
-----END PGP SIGNATURE-----
- [BUG] overlay 'line-height property is invalid when window width change,
stardiviner <=