mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Replace unique_ptr w/std::optional for optional values in doc::Brush
This commit is contained in:
parent
d029efbcc0
commit
66496bdcd2
@ -249,10 +249,10 @@ void Brush::setImageColor(ImageColor imageColor, color_t color)
|
||||
|
||||
switch (imageColor) {
|
||||
case ImageColor::MainColor:
|
||||
m_mainColor.reset(new color_t(color));
|
||||
m_mainColor = color_t(color);
|
||||
break;
|
||||
case ImageColor::BackgroundColor:
|
||||
m_bgColor.reset(new color_t(color));
|
||||
m_bgColor = color_t(color);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "gfx/rect.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
namespace doc {
|
||||
@ -97,8 +98,8 @@ namespace doc {
|
||||
|
||||
// Extra data used for setImageColor()
|
||||
ImageRef m_backupImage; // Backup image to avoid losing original brush colors/pattern
|
||||
std::unique_ptr<color_t> m_mainColor; // Main image brush color (nullptr if it wasn't specified)
|
||||
std::unique_ptr<color_t> m_bgColor; // Background color (nullptr if it wasn't specified)
|
||||
std::optional<color_t> m_mainColor; // Main image brush color
|
||||
std::optional<color_t> m_bgColor; // Background color
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<Brush> BrushRef;
|
||||
|
Loading…
x
Reference in New Issue
Block a user