Skip to content

Commit 473b8cb

Browse files
authored
Merge pull request #6 from j4james/fix-background-fill
Fix background select interpretation and 0:1 aspect ratio
2 parents d28a272 + c1687a1 commit 473b8cb

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

j4james/margin_clipping.sh

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ echo -n ${ST}
8181
set_margin 4 21
8282
set_cursor_pos 4 41
8383
echo ${DCS}'2;0q'
84+
echo '?' # trigger background fill
8485
blank_lines 2
8586
multicolor_lines 4 '#9' '#11' true '!80?'
8687
multicolor_lines 4 '#11' '#9' false '!80?'

j4james/raster_aspect_ratio.sh

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# Test of the raster attributes aspect ratio in a Sixel image.
44

55
# If an image includes a raster attributes command, the first two parameters
6-
# define numerator and denominator of the pixel aspect ratio. On a genuine
7-
# VT340, this ratio is rounded up to the nearest integer value. For example.
8-
# 3:2 is 1.5, which rounds up to 2 (i.e. an aspect ratio of 2:1).
6+
# define the numerator and denominator of the pixel aspect ratio. On a genuine
7+
# VT340, this ratio is rounded up to the nearest integer value, with a minimum
8+
# value of 1. For example, 3:2 is 1.5, which rounds up to 2 (i.e. an aspect
9+
# ratio of 2:1). If the denominator is zero, the aspect ratio is ignored, and
10+
# will fall back to the value determined by the initial macro parameter.
911

1012
CSI=$'\e[' # Control Sequence Introducer
1113
DCS=$'\eP' # Device Control String
@@ -49,13 +51,13 @@ range_test() {
4951
done
5052
}
5153

52-
aspect_ratio_test 8 '' 2
53-
aspect_ratio_test 18 '0;0' 2
54-
aspect_ratio_test 28 '0;1' 2
55-
aspect_ratio_test 38 '1;3' 10
56-
aspect_ratio_test 48 '3;2' 5
57-
aspect_ratio_test 58 '7;4' 5
58-
aspect_ratio_test 68 '37;4' 1
54+
aspect_ratio_test 8 '' 2 # a blank AR falls back to the macro parameter value (5:1)
55+
aspect_ratio_test 18 '0;0' 2 # a zero denominator also falls back to 5:1
56+
aspect_ratio_test 28 '0;1' 10 # 0:1 = 0, but the minimum is 1:1
57+
aspect_ratio_test 38 '1;3' 10 # 1:3 = 0.333, which rounds up to 1:1
58+
aspect_ratio_test 48 '3;2' 5 # 3:2 = 1.5, which rounds up to 2:1
59+
aspect_ratio_test 58 '7;4' 5 # 7:4 = 1.75, which rounds up to 2:1
60+
aspect_ratio_test 68 '37;4' 1 # 37:4 = 9.25, which rounds up to 10:1
5961

6062
range_test
6163

j4james/raster_dimensions.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ raster_test() {
3131
echo ${ST}${suffix}
3232
}
3333

34-
raster_test 4 8 1 '2;1;120;60' '#1----!48?!24~-!48?!24~'
35-
raster_test 4 26 1 '2;1;60;60' '#1!12?!108~-!24?!96~-!36?!84~-!48?!72~-!60?!60~' '.'
36-
raster_test 4 44 1 '2;1;120;30' '#1!12~-!24~-!36~-!48~-!60~-!60~-!60~-!60~-!60~-!60~'
37-
raster_test 4 62 1 '2;1;0;0' '#1!12?!108~-!24?!96~-!36?!84~-!48?!72~-!60?!60~-!60?-!60?-!60?-!60?-!60?-'
38-
raster_test 16 7 2 '5;1;245;17' '#1!245~#0!35~-#1!30~-!30~-#0!30~'
39-
raster_test 13 41 2 '5;1' '#1--!60?!280~-!60?!280~-!60?!280~-!60?!280~'
34+
raster_test 4 8 1 '2;1;120;120' '#1?----!48?!24~-!48?!24~'
35+
raster_test 4 26 1 '2;1;60;120' '#1!12?!108~-!24?!96~-!36?!84~-!48?!72~-!60?!60~' '.'
36+
raster_test 4 44 1 '2;1;120;60' '#1!12~-!24~-!36~-!48~-!60~-!60~-!60~-!60~-!60~-!60~'
37+
raster_test 1 62 1 '2;1;60;120' '#1-----!12?!108~-!24?!96~-!36?!84~-!48?!72~-!60?!60~'
38+
raster_test 16 7 2 '5;1;245;90' '#1!245~#0!35~-#1!30~-!30~-#0!30~'
39+
raster_test 13 41 2 '5;1;;0' '#1?--!60?!280~-!60?!280~-!60?!280~-!60?!280~'
4040

4141
set_cursor_pos 11 1

0 commit comments

Comments
 (0)