add missing image scaling
property meta type + replace to integer conversion with comparison operator in enumeration_wrapper + change order in value_base_type (ref #4045)
This commit is contained in:
parent
b890dc2775
commit
e90a4fca7d
3 changed files with 11 additions and 4 deletions
|
@ -97,6 +97,7 @@ enum class property_types : std::uint8_t
|
||||||
target_font_feature_settings,
|
target_font_feature_settings,
|
||||||
target_line_pattern,
|
target_line_pattern,
|
||||||
target_smooth_algorithm,
|
target_smooth_algorithm,
|
||||||
|
target_scaling_method
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -68,10 +68,11 @@ struct enumeration_wrapper
|
||||||
explicit enumeration_wrapper(T value_)
|
explicit enumeration_wrapper(T value_)
|
||||||
: value(value_) {}
|
: value(value_) {}
|
||||||
|
|
||||||
inline operator int() const
|
inline bool operator==(enumeration_wrapper const& rhs) const
|
||||||
{
|
{
|
||||||
return value;
|
return value == rhs.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using dash_array = std::vector<std::pair<double,double> >;
|
using dash_array = std::vector<std::pair<double,double> >;
|
||||||
|
@ -82,8 +83,8 @@ using text_placements_ptr = std::shared_ptr<text_placements>;
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
using value_base_type = util::variant<value_bool,
|
using value_base_type = util::variant<value_bool,
|
||||||
value_integer,
|
|
||||||
enumeration_wrapper,
|
enumeration_wrapper,
|
||||||
|
value_integer,
|
||||||
value_double,
|
value_double,
|
||||||
std::string,
|
std::string,
|
||||||
color,
|
color,
|
||||||
|
|
|
@ -90,7 +90,12 @@ static const property_meta_type key_meta[const_max_key] =
|
||||||
property_meta_type{ "shield-dy", nullptr, property_types::target_double },
|
property_meta_type{ "shield-dy", nullptr, property_types::target_double },
|
||||||
property_meta_type{ "unlock-image", nullptr, property_types::target_bool },
|
property_meta_type{ "unlock-image", nullptr, property_types::target_bool },
|
||||||
property_meta_type{ "mode", nullptr, property_types::target_double },
|
property_meta_type{ "mode", nullptr, property_types::target_double },
|
||||||
property_meta_type{ "scaling", nullptr, property_types::target_double },
|
property_meta_type{ "scaling",
|
||||||
|
[](enumeration_wrapper e)
|
||||||
|
{
|
||||||
|
return *scaling_method_to_string(scaling_method_e(e.value));
|
||||||
|
},
|
||||||
|
property_types::target_scaling_method},
|
||||||
property_meta_type{ "filter-factor", nullptr, property_types::target_double },
|
property_meta_type{ "filter-factor", nullptr, property_types::target_double },
|
||||||
property_meta_type{ "mesh-size", nullptr, property_types::target_double },
|
property_meta_type{ "mesh-size", nullptr, property_types::target_double },
|
||||||
property_meta_type{ "premultiplied", nullptr, property_types::target_bool },
|
property_meta_type{ "premultiplied", nullptr, property_types::target_bool },
|
||||||
|
|
Loading…
Add table
Reference in a new issue