forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrush_type.cpp
39 lines (33 loc) · 851 Bytes
/
brush_type.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Aseprite Document Library
// Copyright (c) 2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "doc/brush_type.h"
namespace doc {
std::string brush_type_to_string_id(BrushType brushType)
{
switch (brushType) {
case kCircleBrushType: return "circle";
case kSquareBrushType: return "square";
case kLineBrushType: return "line";
case kImageBrushType: return "image";
}
return "unknown";
}
BrushType string_id_to_brush_type(const std::string& s)
{
if (s == "circle")
return kCircleBrushType;
if (s == "square")
return kSquareBrushType;
if (s == "line")
return kLineBrushType;
if (s == "image")
return kImageBrushType;
return kFirstBrushType;
}
} // namespace doc