From b241326003180aa9808ee020c1e4b346154abd81 Mon Sep 17 00:00:00 2001 From: James Holderness Date: Thu, 15 Aug 2024 15:33:01 +0100 Subject: [PATCH 1/2] Remove unneeded 4 pixel width alignment. --- src/buffer/out/ImageSlice.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/buffer/out/ImageSlice.cpp b/src/buffer/out/ImageSlice.cpp index 4950682ee89..65809e58a04 100644 --- a/src/buffer/out/ImageSlice.cpp +++ b/src/buffer/out/ImageSlice.cpp @@ -65,7 +65,6 @@ RGBQUAD* ImageSlice::MutablePixels(const til::CoordType columnBegin, const til:: _columnBegin = existingData ? std::min(_columnBegin, columnBegin) : columnBegin; _columnEnd = existingData ? std::max(_columnEnd, columnEnd) : columnEnd; _pixelWidth = (_columnEnd - _columnBegin) * _cellSize.width; - _pixelWidth = (_pixelWidth + 3) & ~3; // Renderer needs this as a multiple of 4 const auto bufferSize = _pixelWidth * _cellSize.height; if (existingData) { From c46a1d5e6e358d533a5800da3b963d555cba5150 Mon Sep 17 00:00:00 2001 From: James Holderness Date: Thu, 15 Aug 2024 15:35:50 +0100 Subject: [PATCH 2/2] Simplify dstHeight calculation in GDI PaintImageSlice. --- src/renderer/gdi/paint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/gdi/paint.cpp b/src/renderer/gdi/paint.cpp index 17e0f66e4ee..58eca36f843 100644 --- a/src/renderer/gdi/paint.cpp +++ b/src/renderer/gdi/paint.cpp @@ -685,7 +685,7 @@ try const auto srcWidth = imageSlice.PixelWidth(); const auto srcHeight = srcCellSize.height; const auto dstWidth = srcWidth * dstCellSize.width / srcCellSize.width; - const auto dstHeight = srcHeight * dstCellSize.height / srcCellSize.height; + const auto dstHeight = dstCellSize.height; const auto x = (imageSlice.ColumnOffset() - viewportLeft) * dstCellSize.width; const auto y = targetRow * dstCellSize.height;