Skip to content

Commit

Permalink
Slight code cleanup on paste. Same behaviour. Better comment for 16bpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescan committed Jun 6, 2024
1 parent 4d64fb9 commit 43f3dbb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Src/TacentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ bool Viewer::OnPasteImageFromClipboard()
}

// For 32bpp we only support component masks that have 8 bits set.
if (bpp == 32)
else if (bpp == 32)
{
if ((rmask >> rshift) != 0xFF) return false;
if ((gmask >> gshift) != 0xFF) return false;
Expand All @@ -1318,13 +1318,14 @@ bool Viewer::OnPasteImageFromClipboard()
}

// For 64bpp we only support component masks that have 16 bits set.
if (bpp == 64)
else if (bpp == 64)
{
if ((rmask >> rshift) != 0xFFFF) return false;
if ((gmask >> gshift) != 0xFFFF) return false;
if ((bmask >> bshift) != 0xFFFF) return false;
if (amask && ((amask >> ashift) != 0xFFFF)) return false;
}
// We fall through here so that the 16bpp version of GetClipboard16BPPColour will be called.

int bytesPerRow = spec.bytes_per_row;
int bytesPerPixel = bpp / 8;
Expand Down

0 comments on commit 43f3dbb

Please sign in to comment.