[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-lib f9e1bbb 32/32: Fix some warnings
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-lib f9e1bbb 32/32: Fix some warnings |
Date: |
Mon, 27 Sep 2021 16:57:51 -0400 (EDT) |
branch: externals/svg-lib
commit f9e1bbba5f233d146d311e880c9a73ab6a6c9c66
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Fix some warnings
---
svg-lib-demo.el | 23 ++++++++++++++++++++++-
svg-lib.el | 53 ++++++++++++++++++++++++++++-------------------------
2 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/svg-lib-demo.el b/svg-lib-demo.el
index 23dc64b..eeeb6fa 100644
--- a/svg-lib-demo.el
+++ b/svg-lib-demo.el
@@ -1,3 +1,25 @@
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; For a full copy of the GNU General Public License
+;; see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; This file demonstrates some usage examples of the svg-lib package.
+:; Each line should insert some svg objets into the current buffer.
+
(require 'svg-lib)
(dotimes (i 5)
@@ -38,4 +60,3 @@
(insert-image (svg-lib-icon "gnuemacs" nil :collection "simple"
:stroke 0 :scale 1 :padding 0))
- GNU Emacs
diff --git a/svg-lib.el b/svg-lib.el
index b3df0f5..9de819f 100644
--- a/svg-lib.el
+++ b/svg-lib.el
@@ -75,6 +75,7 @@
(require 'svg)
(require 'xml)
(require 'cl-lib)
+(require 'color)
;; Check if Emacs has been compiled with svg support
(if (not (image-type-available-p 'svg))
@@ -212,10 +213,10 @@ and style elements ARGS."
(foreground (plist-get style :foreground))
(background (plist-get style :background))
(stroke (plist-get style :stroke))
- (width (plist-get style :width))
+ ;; (width (plist-get style :width))
(height (plist-get style :height))
(radius (plist-get style :radius))
- (scale (plist-get style :scale))
+ ;; (scale (plist-get style :scale))
(margin (plist-get style :margin))
(padding (plist-get style :padding))
(font-size (plist-get style :font-size))
@@ -227,7 +228,7 @@ and style elements ARGS."
(font-info (font-info (format "%s-%d" font-family font-size)))
(ascent (aref font-info 8))
(tag-char-width (aref font-info 11))
- (tag-char-height (aref font-info 3))
+ ;; (tag-char-height (aref font-info 3))
(tag-width (* (+ (length label) padding) txt-char-width))
(tag-height (* txt-char-height height))
@@ -265,22 +266,22 @@ and style elements ARGS."
(foreground (plist-get style :foreground))
(background (plist-get style :background))
(stroke (plist-get style :stroke))
- (width (plist-get style :width))
+ ;; (width (plist-get style :width))
(height (plist-get style :height))
- (scale (plist-get style :scale))
+ ;; (scale (plist-get style :scale))
(margin (plist-get style :margin))
(padding (plist-get style :padding))
(font-size (plist-get style :font-size))
(font-family (plist-get style :font-family))
- (font-weight (plist-get style :font-weight))
+ ;; (font-weight (plist-get style :font-weight))
(txt-char-width (window-font-width))
(txt-char-height (window-font-height))
(font-info (font-info (format "%s-%d" font-family font-size)))
- (ascent (aref font-info 8))
- (tag-char-width (aref font-info 11))
- (tag-char-height (aref font-info 3))
+ ;; (ascent (aref font-info 8))
+ ;; (tag-char-width (aref font-info 11))
+ ;; (tag-char-height (aref font-info 3))
(tag-width (* 2 txt-char-width))
(tag-height (* txt-char-height height))
@@ -288,7 +289,7 @@ 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))
(cx (/ svg-width 2))
(cy (/ svg-height 2))
@@ -296,11 +297,11 @@ and style elements ARGS."
(iradius (- radius stroke (/ padding 2)))
- (angle0 (- (/ pi 2)))
+ (angle0 (- (/ float-pi 2)))
(x0 (+ cx (* iradius (cos angle0))))
(y0 (+ cy (* iradius (sin angle0))))
- (angle1 (+ angle0 (* value 2 pi)))
+ (angle1 (+ angle0 (* value 2 float-pi)))
(x1 (+ cx (* iradius (cos angle1))))
(y1 (+ cy (* iradius (sin angle1))))
@@ -338,20 +339,20 @@ and style elements ARGS."
(width (plist-get style :width))
(height (plist-get style :height))
(radius (plist-get style :radius))
- (scale (plist-get style :scale))
+ ;; (scale (plist-get style :scale))
(margin (plist-get style :margin))
(padding (plist-get style :padding))
(font-size (plist-get style :font-size))
(font-family (plist-get style :font-family))
- (font-weight (plist-get style :font-weight))
+ ;; (font-weight (plist-get style :font-weight))
(txt-char-width (window-font-width))
(txt-char-height (window-font-height))
(font-info (font-info (format "%s-%d" font-family font-size)))
(ascent (aref font-info 8))
- (tag-char-width (aref font-info 11))
- (tag-char-height (aref font-info 3))
+ ;; (tag-char-width (aref font-info 11))
+ ;; (tag-char-height (aref font-info 3))
(tag-width (* width txt-char-width))
(tag-height (* txt-char-height height))
@@ -425,9 +426,9 @@ given STYLE and style elements ARGS."
(scale (plist-get style :scale))
(margin (plist-get style :margin))
(padding (plist-get style :padding))
- (font-size (plist-get style :font-size))
- (font-family (plist-get style :font-family))
- (font-weight (plist-get style :font-weight))
+ ;; (font-size (plist-get style :font-size))
+ ;; (font-family (plist-get style :font-family))
+ ;; (font-weight (plist-get style :font-weight))
(width (+ 2 padding))
(txt-char-width (window-font-width))
@@ -441,7 +442,7 @@ given STYLE and style elements ARGS."
;; Read original viewbox
(viewbox (cdr (assq 'viewBox (xml-node-attributes (car root)))))
- (viewbox (mapcar 'string-to-number (split-string viewbox)))
+ (viewbox (mapcar #'string-to-number (split-string viewbox)))
(icon-x (nth 0 viewbox))
(icon-y (nth 1 viewbox))
(icon-width (nth 2 viewbox))
@@ -469,7 +470,8 @@ given STYLE and style elements ARGS."
(dolist (item (xml-get-children (car root) 'path))
(let* ((attrs (xml-node-attributes item))
(path (cdr (assoc 'd attrs)))
- (fill (or (cdr (assoc 'fill attrs)) foreground)))
+ ;; (fill (or (cdr (assoc 'fill attrs)) foreground))
+ )
(svg-node svg 'path :d path
:fill foreground
:transform icon-transform)))
@@ -506,13 +508,13 @@ and style elements ARGS."
(txt-char-width (window-font-width))
(txt-char-height (window-font-height))
- (box-width (* width txt-char-width))
- (box-height (* height txt-char-height))
+ ;; (box-width (* width txt-char-width))
+ ;; (box-height (* height txt-char-height))
(font-info (font-info (format "%s-%d" font-family font-size)))
(ascent (aref font-info 8))
(tag-char-width (aref font-info 11))
- (tag-char-height (aref font-info 3))
+ ;; (tag-char-height (aref font-info 3))
(tag-width (* (+ label-length padding) txt-char-width))
(tag-height (* txt-char-height height))
@@ -555,7 +557,8 @@ and style elements ARGS."
(dolist (item (xml-get-children (car root) 'path))
(let* ((attrs (xml-node-attributes item))
(path (cdr (assoc 'd attrs)))
- (fill (or (cdr (assoc 'fill attrs)) foreground)))
+ ;; (fill (or (cdr (assoc 'fill attrs)) foreground))
+ )
(svg-node svg 'path :d path
:fill foreground
:transform icon-transform)))
- [elpa] externals/svg-lib 461c155 06/32: Update with new style, (continued)
- [elpa] externals/svg-lib 461c155 06/32: Update with new style, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib e2d2d68 10/32: Better screenshot, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 952016b 11/32: Fix tasks status, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib ebde091 22/32: Added progress pies, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib b67b120 30/32: Cosmetic changes, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 90bb561 18/32: Added tag example, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 0ce0302 19/32: Merge remote-tracking branch 'origin/master', ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 83834c6 20/32: Fix usage example in comment., ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 6876d54 26/32: Fix `font-info` query format., ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 2cab1a0 29/32: Merge remote-tracking branch 'origin/master', ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib f9e1bbb 32/32: Fix some warnings,
ELPA Syncer <=
- [elpa] externals/svg-lib 04fdd1a 08/32: Added svg-lib-concat function for org-mode demo, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib d9a49ac 14/32: Delete the redundant url checking, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 6ceae83 16/32: Change `svg-lib-icons-dir` default value, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib f775af4 21/32: Merge pull request #5 from 404cn/master, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 8427772 23/32: Merge remote-tracking branch 'origin/master', ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 5c206f3 24/32: Remove hard coded image scaling factor, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib f0b2136 25/32: Merge pull request #7 from HyunggyuJang/remove-hard-image-scale, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib e0423a2 27/32: Merge pull request #8 from HyunggyuJang/fix-font-info-query-format, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 11bc5dc 28/32: Make stroke to be fully contained inside the svg, ELPA Syncer, 2021/09/27
- [elpa] externals/svg-lib 5cb5865 31/32: Bug fix, ELPA Syncer, 2021/09/27