This commit is contained in:
parent
5351e9aa0a
commit
804d78e116
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
#include "drawcommand.hpp"
|
||||
|
||||
@ -120,7 +119,8 @@ void DrawCommand::lineUpdate(ox::Point a, ox::Point b) noexcept {
|
||||
if (a.x > b.x) { --b.x; }
|
||||
iterateLine(a, b, [this, &ss](int32_t const x, int32_t const y, int32_t const h) {
|
||||
int const mod = h < 0 ? -1 : 1;
|
||||
for (int32_t i{}; i < abs(h); ++i) {
|
||||
auto const range = h * mod;
|
||||
for (int32_t i{}; i < range; ++i) {
|
||||
auto const idx = ptToIdx(x, y + i * mod, ss.columns * TileWidth);
|
||||
if (idx < ss.pixels.size()) {
|
||||
m_changes.emplace_back(static_cast<uint32_t>(idx), getPixel(ss, idx));
|
||||
|
Loading…
x
Reference in New Issue
Block a user