mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 00:58:15 -04:00
xcf: Fix fix for opacity being out of bounds
If max opacity is 255 we want the min between opacity and 255 and not the max
This commit is contained in:
parent
8e48d67568
commit
8d0b625538
@ -676,7 +676,7 @@ bool XCFImageFormat::loadLayerProperties(QDataStream &xcf_io, Layer &layer)
|
||||
|
||||
case PROP_OPACITY:
|
||||
property >> layer.opacity;
|
||||
layer.opacity = std::max(layer.opacity, 255u);
|
||||
layer.opacity = std::min(layer.opacity, 255u);
|
||||
break;
|
||||
|
||||
case PROP_VISIBLE:
|
||||
@ -1302,7 +1302,7 @@ bool XCFImageFormat::loadChannelProperties(QDataStream &xcf_io, Layer &layer)
|
||||
|
||||
case PROP_OPACITY:
|
||||
property >> layer.mask_channel.opacity;
|
||||
layer.mask_channel.opacity = std::max(layer.mask_channel.opacity, 255u);
|
||||
layer.mask_channel.opacity = std::min(layer.mask_channel.opacity, 255u);
|
||||
break;
|
||||
|
||||
case PROP_VISIBLE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user