mirror of
https://github.com/SFML/SFML.git
synced 2025-02-23 14:56:02 +08:00
Simplify determining difference type
This commit is contained in:
parent
619e532fc2
commit
0455e581a6
@ -562,9 +562,8 @@ void Image::flipHorizontally()
|
|||||||
|
|
||||||
for (std::size_t y = 0; y < m_size.y; ++y)
|
for (std::size_t y = 0; y < m_size.y; ++y)
|
||||||
{
|
{
|
||||||
auto left = m_pixels.begin() + static_cast<std::vector<std::uint8_t>::iterator::difference_type>(y * rowSize);
|
auto left = m_pixels.begin() + static_cast<std::vector<std::uint8_t>::difference_type>(y * rowSize);
|
||||||
auto right = m_pixels.begin() +
|
auto right = m_pixels.begin() + static_cast<std::vector<std::uint8_t>::difference_type>((y + 1) * rowSize - 4);
|
||||||
static_cast<std::vector<std::uint8_t>::iterator::difference_type>((y + 1) * rowSize - 4);
|
|
||||||
|
|
||||||
for (std::size_t x = 0; x < m_size.x / 2; ++x)
|
for (std::size_t x = 0; x < m_size.x / 2; ++x)
|
||||||
{
|
{
|
||||||
@ -583,7 +582,7 @@ void Image::flipVertically()
|
|||||||
{
|
{
|
||||||
if (!m_pixels.empty())
|
if (!m_pixels.empty())
|
||||||
{
|
{
|
||||||
const auto rowSize = static_cast<std::vector<std::uint8_t>::iterator::difference_type>(m_size.x * 4);
|
const auto rowSize = static_cast<std::vector<std::uint8_t>::difference_type>(m_size.x * 4);
|
||||||
|
|
||||||
auto top = m_pixels.begin();
|
auto top = m_pixels.begin();
|
||||||
auto bottom = m_pixels.end() - rowSize;
|
auto bottom = m_pixels.end() - rowSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user