diff options
| author | Alan Third | 2019-06-16 20:10:20 +0100 |
|---|---|---|
| committer | Alan Third | 2019-06-16 20:24:53 +0100 |
| commit | cf3081d208814ea02fce33aac645abfc24f880a6 (patch) | |
| tree | 7c840344a0a6edbf6bc9ee9debcb690877e417d8 /test | |
| parent | 11b0e33462fa7ebef142953010e25728543d1be8 (diff) | |
| download | emacs-cf3081d208814ea02fce33aac645abfc24f880a6.tar.gz emacs-cf3081d208814ea02fce33aac645abfc24f880a6.zip | |
Simplify image transforms
* src/image.c: (image_set_rotation, image_set_size,
image_set_transform): Combine into image_set_transform.
(image_set_crop): Remove function.
(lookup_image): Remove calls to removed functions and remove
transform_matrix.
* test/manual/image-transforms-tests.el (test-cropping): Remove
function.
(test-transforms): Remove reference to test-cropping.
Diffstat (limited to 'test')
| -rw-r--r-- | test/manual/image-transforms-tests.el | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el index d601b9397e3..907f0639e4c 100644 --- a/test/manual/image-transforms-tests.el +++ b/test/manual/image-transforms-tests.el | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | 25 | ||
| 26 | ;; Type M-x test-transforms RET to generate the test buffer. | 26 | ;; Type M-x test-transforms RET to generate the test buffer. |
| 27 | 27 | ||
| 28 | ;; There is a difference in how librsvg and ImageMagick draw some of | ||
| 29 | ;; the images. This results in what looks like a one pixel difference. | ||
| 30 | |||
| 28 | ;;; Code: | 31 | ;;; Code: |
| 29 | 32 | ||
| 30 | (defun test-rotation () | 33 | (defun test-rotation () |
| @@ -44,36 +47,6 @@ | |||
| 44 | (insert-test "45" up up '(:rotation 45))) | 47 | (insert-test "45" up up '(:rotation 45))) |
| 45 | (insert "\n\n")) | 48 | (insert "\n\n")) |
| 46 | 49 | ||
| 47 | (defun test-cropping () | ||
| 48 | (let ((image "<svg height='30' width='30'> | ||
| 49 | <rect x='0' y='0' width='10' height='10'/> | ||
| 50 | <rect x='10' y='10' width='10' height='10' | ||
| 51 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 52 | <line x1='10' y1='10' x2='20' y2='20' style='stroke:#000'/> | ||
| 53 | <line x1='20' y1='10' x2='10' y2='20' style='stroke:#000'/> | ||
| 54 | <rect x='20' y='20' width='10' height='10' | ||
| 55 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 56 | </svg>") | ||
| 57 | (top-left "<svg height='10' width='10'> | ||
| 58 | <rect x='0' y='0' width='10' height='10'/> | ||
| 59 | </svg>") | ||
| 60 | (middle "<svg height='10' width='10'> | ||
| 61 | <rect x='0' y='0' width='10' height='10' | ||
| 62 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 63 | <line x1='0' y1='0' x2='10' y2='10' style='stroke:#000'/> | ||
| 64 | <line x1='10' y1='0' x2='0' y2='10' style='stroke:#000'/> | ||
| 65 | </svg>") | ||
| 66 | (bottom-right "<svg height='10' width='10'> | ||
| 67 | <rect x='0' y='0' width='10' height='10' | ||
| 68 | style='fill:none;stroke-width:1;stroke:#000'/> | ||
| 69 | </svg>")) | ||
| 70 | (insert-header "Test Crop: cropping an image") | ||
| 71 | (insert-test "all params" top-left image '(:crop (10 10 0 0))) | ||
| 72 | (insert-test "width/height only" middle image '(:crop (10 10))) | ||
| 73 | (insert-test "negative x y" middle image '(:crop (10 10 -10 -10))) | ||
| 74 | (insert-test "all params" bottom-right image '(:crop (10 10 20 20)))) | ||
| 75 | (insert "\n\n")) | ||
| 76 | |||
| 77 | (defun test-scaling () | 50 | (defun test-scaling () |
| 78 | (let ((image "<svg height='10' width='10'> | 51 | (let ((image "<svg height='10' width='10'> |
| 79 | <rect x='0' y='0' width='10' height='10' | 52 | <rect x='0' y='0' width='10' height='10' |
| @@ -170,7 +143,6 @@ | |||
| 170 | (unless #'imagemagick-types | 143 | (unless #'imagemagick-types |
| 171 | (insert "ImageMagick not detected. ImageMagick tests will be skipped.\n\n")) | 144 | (insert "ImageMagick not detected. ImageMagick tests will be skipped.\n\n")) |
| 172 | (test-rotation) | 145 | (test-rotation) |
| 173 | (test-cropping) | ||
| 174 | (test-scaling) | 146 | (test-scaling) |
| 175 | (test-scaling-rotation) | 147 | (test-scaling-rotation) |
| 176 | (goto-char (point-min)))) | 148 | (goto-char (point-min)))) |