diff options
author | Alan Third <alan@idiocy.org> | 2020-08-23 16:28:17 +0100 |
---|---|---|
committer | Alan Third <alan@idiocy.org> | 2020-08-23 16:28:17 +0100 |
commit | 8f42b94fe43911c6b0c7e519ba439d61459dc744 (patch) | |
tree | 4786e52acf27cf3a5262d8b283f1ed8ac1b073e6 /test | |
parent | 4aff89ece6d9ceee882375879518b71ca6a89a70 (diff) | |
download | emacs-8f42b94fe43911c6b0c7e519ba439d61459dc744.tar.gz |
Set basic SVG attributes (bug#40845)
* test/manual/image-transforms-tests.el: Replace hard-coded colors
with defaults.
* src/dispextern.h (struct image):
* src/image.c (search_image_cache):
(xbm_load_image):
(xbm_load):
(pbm_load): Rename from frame to face where relevant.
(svg_load_image): Parse the image to find out the size, then wrap it
in another SVG to set a new size and colors, etc.
(lookup_image): Use the face colors instead of the frame colors.
(search_image_cache): Add ability to ignore the face colors.
(uncache_image): Uncache all copies of the image that share the spec,
even if the face colors don't match.
* etc/NEWS: Describe the changes.
Diffstat (limited to 'test')
-rw-r--r-- | test/manual/image-transforms-tests.el | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el index 0ebd5c7a195..02607e63676 100644 --- a/test/manual/image-transforms-tests.el +++ b/test/manual/image-transforms-tests.el @@ -48,24 +48,24 @@ (let ((image "<svg height='30' width='30'> <rect x='0' y='0' width='10' height='10'/> <rect x='10' y='10' width='10' height='10' - style='fill:none;stroke-width:1;stroke:#000'/> - <line x1='10' y1='10' x2='20' y2='20' style='stroke:#000'/> - <line x1='20' y1='10' x2='10' y2='20' style='stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> + <line x1='10' y1='10' x2='20' y2='20' style='stroke:currentColor'/> + <line x1='20' y1='10' x2='10' y2='20' style='stroke:currentColor'/> <rect x='20' y='20' width='10' height='10' - style='fill:none;stroke-width:1;stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> </svg>") (top-left "<svg height='10' width='10'> <rect x='0' y='0' width='10' height='10'/> </svg>") (middle "<svg height='10' width='10'> <rect x='0' y='0' width='10' height='10' - style='fill:none;stroke-width:1;stroke:#000'/> - <line x1='0' y1='0' x2='10' y2='10' style='stroke:#000'/> - <line x1='10' y1='0' x2='0' y2='10' style='stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> + <line x1='0' y1='0' x2='10' y2='10' style='stroke:currentColor'/> + <line x1='10' y1='0' x2='0' y2='10' style='stroke:currentColor'/> </svg>") (bottom-right "<svg height='10' width='10'> <rect x='0' y='0' width='10' height='10' - style='fill:none;stroke-width:1;stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> </svg>")) (insert-header "Test Crop: cropping an image (only works with ImageMagick)") (insert-test "all params" top-left image '(:crop (10 10 0 0))) @@ -77,23 +77,23 @@ (defun test-scaling () (let ((image "<svg height='10' width='10'> <rect x='0' y='0' width='10' height='10' - style='fill:none;stroke-width:1;stroke:#000'/> - <line x1='0' y1='0' x2='10' y2='10' style='stroke:#000'/> - <line x1='10' y1='0' x2='0' y2='10' style='stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> + <line x1='0' y1='0' x2='10' y2='10' style='stroke:currentColor'/> + <line x1='10' y1='0' x2='0' y2='10' style='stroke:currentColor'/> </svg>") (large "<svg height='20' width='20'> <rect x='0' y='0' width='20' height='20' - style='fill:none;stroke-width:2;stroke:#000'/> + style='fill:none;stroke-width:2;stroke:currentColor'/> <line x1='0' y1='0' x2='20' y2='20' - style='stroke-width:2;stroke:#000'/> + style='stroke-width:2;stroke:currentColor'/> <line x1='20' y1='0' x2='0' y2='20' - style='stroke-width:2;stroke:#000'/> + style='stroke-width:2;stroke:currentColor'/> </svg>") (small "<svg height='5' width='5'> <rect x='0' y='0' width='4' height='4' - style='fill:none;stroke-width:1;stroke:#000'/> - <line x1='0' y1='0' x2='4' y2='4' style='stroke:#000'/> - <line x1='4' y1='0' x2='0' y2='4' style='stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> + <line x1='0' y1='0' x2='4' y2='4' style='stroke:currentColor'/> + <line x1='4' y1='0' x2='0' y2='4' style='stroke:currentColor'/> </svg>")) (insert-header "Test Scaling: resize an image (pixelization may occur)") (insert-test "1x" image image '(:scale 1)) @@ -107,27 +107,27 @@ (defun test-scaling-rotation () (let ((image "<svg height='20' width='20'> <rect x='0' y='0' width='20' height='20' - style='fill:none;stroke-width:1;stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> <rect x='0' y='0' width='10' height='10' - style='fill:#000'/> + style='fill:currentColor'/> </svg>") (x2-90 "<svg height='40' width='40'> <rect x='0' y='0' width='40' height='40' - style='fill:none;stroke-width:1;stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> <rect x='20' y='0' width='20' height='20' - style='fill:#000'/> + style='fill:currentColor'/> </svg>") (x2--90 "<svg height='40' width='40'> <rect x='0' y='0' width='40' height='40' - style='fill:none;stroke-width:1;stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> <rect x='0' y='20' width='20' height='20' - style='fill:#000'/> + style='fill:currentColor'/> </svg>") (x0.5-180 "<svg height='10' width='10'> <rect x='0' y='0' width='10' height='10' - style='fill:none;stroke-width:1;stroke:#000'/> + style='fill:none;stroke-width:1;stroke:currentColor'/> <rect x='5' y='5' width='5' height='5' - style='fill:#000'/> + style='fill:currentColor'/> </svg>")) (insert-header "Test Scaling and Rotation: resize and rotate an image (pixelization may occur)") (insert-test "1x, 0 degrees" image image '(:scale 1 :rotation 0)) |