fix document naming and file dialogs preset, add touch scroll, flip thumbnail, scroll gesture and wheel for sidebar

This commit is contained in:
2017-08-12 18:06:36 +01:00
parent 3df8cb4fa5
commit 2711d4e9b0
20 changed files with 160 additions and 29 deletions

View File

@@ -22,3 +22,18 @@ bool Image::load(std::string filename)
m_data = std::unique_ptr<uint8_t[]>(buffer);
return true;
}
void Image::flip()
{
auto flipped = std::make_unique<uint8_t[]>(width*height*4);
int line_size = width * 4;
const uint8_t* src = m_data.get();
uint8_t* dst = flipped.get() + line_size * (height - 1);
for (int y = 0; y < height; y++)
{
std::copy(src, src+line_size, dst);
src += line_size;
dst -= line_size;
}
std::swap(m_data, flipped);
}