mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-20 20:34:17 -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:
@ -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:
|
||||
|
Reference in New Issue
Block a user