Revert 83b2038de1cf2b96891d3c9540948cfd55742a88 to bring back PaintInk::Type::AlphaCompositing introduced in 1509699a46b4f1d658d6ead4c38c7dd35b10b608

This commit is contained in:
David Capello 2020-05-30 20:38:02 -03:00
parent 445e0abb0b
commit 98106cb2be
4 changed files with 7 additions and 3 deletions

View File

@ -104,7 +104,7 @@ Ink* ActiveToolManager::adjustToolInkDependingOnSelectedInkType(
id = tools::WellKnownInks::PaintCopy;
break;
case tools::InkType::ALPHA_COMPOSITING:
id = tools::WellKnownInks::Paint;
id = tools::WellKnownInks::PaintAlphaCompositing;
break;
case tools::InkType::COPY_COLOR:
id = tools::WellKnownInks::PaintCopy;

View File

@ -66,7 +66,7 @@ private:
// (or foreground/background colors)
class PaintInk : public BaseInk {
public:
enum Type { Simple, WithFg, WithBg, Copy, LockAlpha};
enum Type { Simple, WithFg, WithBg, AlphaCompositing, Copy, LockAlpha};
private:
Type m_type;
@ -114,7 +114,8 @@ public:
}
else {
switch (m_type) {
case Simple: {
case Simple:
case AlphaCompositing: {
bool opaque = false;
// Opacity is set to 255 when InkType=Simple in ToolLoopBase()

View File

@ -56,6 +56,7 @@ const char* WellKnownInks::Selection = "selection";
const char* WellKnownInks::Paint = "paint";
const char* WellKnownInks::PaintFg = "paint_fg";
const char* WellKnownInks::PaintBg = "paint_bg";
const char* WellKnownInks::PaintAlphaCompositing = "paint_alpha_compositing";
const char* WellKnownInks::PaintCopy = "paint_copy";
const char* WellKnownInks::PaintLockAlpha = "paint_lock_alpha";
const char* WellKnownInks::Shading = "shading";
@ -115,6 +116,7 @@ ToolBox::ToolBox()
m_inks[WellKnownInks::Paint] = new PaintInk(PaintInk::Simple);
m_inks[WellKnownInks::PaintFg] = new PaintInk(PaintInk::WithFg);
m_inks[WellKnownInks::PaintBg] = new PaintInk(PaintInk::WithBg);
m_inks[WellKnownInks::PaintAlphaCompositing] = new PaintInk(PaintInk::AlphaCompositing);
m_inks[WellKnownInks::PaintCopy] = new PaintInk(PaintInk::Copy);
m_inks[WellKnownInks::PaintLockAlpha] = new PaintInk(PaintInk::LockAlpha);
m_inks[WellKnownInks::Gradient] = new GradientInk();

View File

@ -36,6 +36,7 @@ namespace app {
extern const char* Paint;
extern const char* PaintFg;
extern const char* PaintBg;
extern const char* PaintAlphaCompositing;
extern const char* PaintCopy;
extern const char* PaintLockAlpha;
extern const char* Shading;