[sixel]: re-enable Set Raster Attributes, and fix the ‘pad’ parameter

Now that we explicitly set P2=1, we can safely emit a "Set Raster
Attributes" command, to tell the terminal the final size of the image
up front.

Also fix the ‘pad’ parameter (horizontal aspect ratio); XTerm rejects
sixels with pan or pad set to 0.
pull/1535/head
Daniel Eklöf 4 years ago committed by Nick Black
parent 8b7fa78be1
commit 013ac94cd5

@ -322,7 +322,7 @@ write_sixel_data(FILE* fp, int leny, int lenx, const sixeltable* stab, int* pars
// Set Raster Attributes - pan/pad=1 (pixel aspect ratio), Ph=lenx, Pv=leny
// using Ph/Pv causes a background to be drawn using color register 0 for all
// unspecified pixels, which we do not want.
//fprintf(fp, "\"1;0;%d;%d", lenx, leny);
fprintf(fp, "\"1;1;%d;%d", lenx, leny);
(void)leny;
for(int i = 0 ; i < stab->colors ; ++i){

Loading…
Cancel
Save