message: Inverses y-axis of ImageFragment
diff: @@ -59,30 +59,31 @@ Image::Data RasterizedImage::fragment(Coordinate _pos) const
  // TODO: if input format is (RGB | PNG), transform to RGBA
  auto target = &fragData[0];
  - for (int y = 0; y < availableHeight; ++y)
  - {
  - auto const startOffset = ((pixelOffset.row + y) * image_->width() + pixelOffset.column) * 4;
  - auto const source = &image_->data()[startOffset];
  - target = copy(source, source + availableWidth * 4, target);
  - // fill vertical gap on right
  - for (int x = availableWidth; x < cellSize_.width; ++x)
  + // fill horizontal gap at the bottom
  + for (int y = availableHeight * cellSize_.width; y < cellSize_.height * cellSize_.width; ++y)
  {
  *target++ = defaultColor_.red();
  *target++ = defaultColor_.green();
  *target++ = defaultColor_.blue();
  *target++ = defaultColor_.alpha();
  }
  - }
  - // fill horizontal gap at the bottom
  - for (int y = availableHeight * cellSize_.width; y < cellSize_.height * cellSize_.width; ++y)
  + for (int y = 0; y < availableHeight; ++y)
  + {
  + auto const startOffset = ((pixelOffset.row + (availableHeight - 1 - y)) * image_->width() + pixelOffset.column) * 4;
  + auto const source = &image_->data()[startOffset];
  + target = copy(source, source + availableWidth * 4, target);
  +
  + // fill vertical gap on right
  + for (int x = availableWidth; x < cellSize_.width; ++x)
  {
  *target++ = defaultColor_.red();
  *target++ = defaultColor_.green();
  *target++ = defaultColor_.blue();
  *target++ = defaultColor_.alpha();
  }
  + }
  return fragData;
  }
  