Skip to content

Commit 920e062

Browse files
committed
fix Background extension rectangles
1 parent 02a849c commit 920e062

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/Entities/SLBackground.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,21 @@ void SLBackground::Draw(const Box& targetDimensions, Box& targetBox, bool offset
229229
// Detect if non-wrapping layer dimensions can't cover the whole target area with its main bitmap. If so, fill in the gap with appropriate solid color sampled from the hanging edge.
230230
if (!m_WrapX && bitmapWidth <= targetBoxWidth) {
231231
if (m_FillColorLeft != ColorKeys::g_MaskColor && m_Offset.GetFloorIntX() != 0) {
232-
DrawRectangle(targetBoxCornerX, targetBoxCornerY, targetBoxWidth, targetBoxHeight, {static_cast<unsigned char>(m_FillColorLeft), 0, 0, 0});
232+
DrawRectangle(targetBoxCornerX, targetBoxCornerY, -m_Offset.m_X, targetBoxHeight, {static_cast<unsigned char>(m_FillColorLeft), 0, 0, 255});
233233
// rectfill(targetBitmap, targetBoxCornerX, targetBoxCornerY, targetBoxCornerX - m_Offset.GetFloorIntX(), targetBoxCornerY + targetBoxHeight, m_FillColorLeft);
234234
}
235235
if (m_FillColorRight != ColorKeys::g_MaskColor) {
236-
DrawRectangle(targetBoxCornerX, targetBoxCornerY, targetBoxWidth, targetBoxHeight, {static_cast<unsigned char>(m_FillColorRight), 0, 0, 0});
236+
DrawRectangle(targetBoxCornerX + bitmapWidth - m_Offset.m_X, targetBoxCornerY, targetBoxWidth - bitmapWidth + m_Offset.m_X, targetBoxHeight, {static_cast<unsigned char>(m_FillColorRight), 0, 0, 255});
237237
// rectfill(targetBitmap, targetBoxCornerX + bitmapWidth - m_Offset.GetFloorIntX(), targetBoxCornerY, targetBoxCornerX + targetBoxWidth, targetBoxCornerY + targetBoxHeight, m_FillColorRight);
238238
}
239239
}
240240
if (!m_WrapY && bitmapHeight <= targetBoxHeight) {
241241
if (m_FillColorUp != ColorKeys::g_MaskColor && m_Offset.GetFloorIntY() != 0) {
242-
DrawRectangle(targetBoxCornerX, targetBoxCornerY, targetBoxWidth, targetBoxHeight, {static_cast<unsigned char>(m_FillColorUp), 0, 0, 0});
242+
DrawRectangle(targetBoxCornerX, targetBoxCornerY, targetBoxWidth, - m_Offset.m_Y, {static_cast<unsigned char>(m_FillColorUp), 0, 0, 255});
243243
// rectfill(targetBitmap, targetBoxCornerX, targetBoxCornerY, targetBoxCornerX + targetBoxWidth, targetBoxCornerY - m_Offset.GetFloorIntY(), m_FillColorUp);
244244
}
245245
if (m_FillColorDown != ColorKeys::g_MaskColor) {
246-
DrawRectangle(targetBoxCornerX, targetBoxCornerY, targetBoxWidth, targetBoxHeight, {static_cast<unsigned char>(m_FillColorDown), 0, 0, 0});
246+
DrawRectangle(targetBoxCornerX, targetBoxCornerY + bitmapHeight - m_Offset.m_Y, targetBoxWidth, targetBoxHeight - bitmapHeight + m_Offset.m_Y, {static_cast<unsigned char>(m_FillColorDown), 0, 0, 255});
247247
// rectfill(targetBitmap, targetBoxCornerX, targetBoxCornerY + bitmapHeight - m_Offset.GetFloorIntY(), targetBoxCornerX + targetBoxWidth, targetBoxCornerY + targetBoxHeight, m_FillColorDown);
248248
}
249249
}

0 commit comments

Comments
 (0)