[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-lib c55d756 1/2: Added an alignment parameter
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-lib c55d756 1/2: Added an alignment parameter |
Date: |
Sun, 19 Dec 2021 14:57:38 -0500 (EST) |
branch: externals/svg-lib
commit c55d75674b5e4462369c9ffa5304f81fe02e52dc
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Added an alignment parameter
---
svg-lib.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/svg-lib.el b/svg-lib.el
index 16a8b63..5ffac5a 100644
--- a/svg-lib.el
+++ b/svg-lib.el
@@ -4,7 +4,7 @@
;; Maintainer: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
;; URL: https://github.com/rougier/svg-lib
-;; Version: 0.2
+;; Version: 0.2.1
;; Package-Requires: ((emacs "27.1"))
;; Keywords: svg, icons, tags, convenience
@@ -67,6 +67,9 @@
;;; NEWS:
+;; Version 0.2.1
+;; - Added an alignment parameter for moving tags inside margins.
+
;; Version 0.2
;; - Fix most of the warnings.
@@ -138,11 +141,12 @@ to the default face)."
`(:background ,background
:foreground ,foreground
-
+
:padding 1 ;; In characters (tag and icons) or pixels
(progress)
- :margin 1 ;; In chracters
+ :margin 1 ;; In characters
:stroke 2 ;; In pixels
:radius 3 ;; In pixels
+ :alignment 0.5 ;; Horizontal alignment (in fraction of margin)
:width 20 ;; In characters
:height 0.90 ;; Ratio of text line height
:scale 0.75 ;; Icon scaling
@@ -215,6 +219,8 @@ and style elements ARGS."
(foreground (plist-get style :foreground))
(background (plist-get style :background))
+
+ (alignment (plist-get style :alignment))
(stroke (plist-get style :stroke))
;; (width (plist-get style :width))
(height (plist-get style :height))
@@ -238,7 +244,9 @@ and style elements ARGS."
(svg-width (+ tag-width (* margin txt-char-width)))
(svg-height tag-height)
- (tag-x (/ (- svg-width tag-width) 2))
+ ;; (tag-x (/ (- svg-width tag-width) 2))
+ (tag-x (* (- svg-width tag-width) alignment))
+
(text-x (+ tag-x (/ (- tag-width (* (length label) tag-char-width))
2)))
(text-y ascent)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/svg-lib c55d756 1/2: Added an alignment parameter,
ELPA Syncer <=