diff --git a/src/data/field.hpp b/src/data/field.hpp index bb3de113..3ede7d99 100644 --- a/src/data/field.hpp +++ b/src/data/field.hpp @@ -103,15 +103,15 @@ public: Style(const FieldP&); virtual ~Style(); - const FieldP fieldP; ///< Field this style is for, should have the right type! + const FieldP fieldP; ///< Field this style is for, should have the right type! - int z_index; ///< Stacking of values of this field, higher = on top - int tab_index; ///< Tab index in editor - Scriptable left, top; ///< Position of this field - Scriptable width, height; ///< Position of this field - Scriptable right, bottom; ///< Position of this field - Scriptable angle; ///< Rotation of the box - Scriptable visible; ///< Is this field visible? + int z_index; ///< Stacking of values of this field, higher = on top + int tab_index; ///< Tab index in editor + Scriptable left, top; ///< Position of this field + Scriptable right, bottom; ///< Position of this field + Scriptable width, height; ///< Size of this field + Scriptable angle; ///< Rotation of the box + Scriptable visible; ///< Is this field visible? CachedScriptableMask mask; ///< Mask image enum AutomaticSide { @@ -123,10 +123,10 @@ public: } automatic_side : 8; ///< Which of (left, width, right) and (top, height, bottom) is determined automatically? bool content_dependent; ///< Does this style depend on content properties? - inline RealPoint getPos() const { return RealPoint(left, top); } - inline RealSize getSize() const { return RealSize(width, height); } - inline RealRect getExternalRect() const { return RealRect(left, top, width, height); } - inline String getExternalRectString(double scale, Radians angle, double bleed, int img_width, int img_height, int img_offset) { ///< update the style before calling this + inline RealPoint getPos() const { return RealPoint(left, top); } + inline RealSize getSize() const { return RealSize(width, height); } + inline RealRect getExternalRect() const { return RealRect(left, top, width, height); } + inline std::string getExternalRectString(double scale, Radians angle, double bleed, int img_width, int img_height, int img_offset) { ///< update the style before calling this double x = left * scale, y = top * scale; double w = width * scale, h = height * scale; RealRect rect(x, y, w, h); @@ -142,14 +142,14 @@ public: rect = RealRect(img_width - y - h, x, h, w); degrees = 270; } else { - return _(""); + return ""; } - return _("---") + wxString::Format(wxT("%i"), (int)std::ceil( rect.x + bleed + img_offset)) + - _("-") + wxString::Format(wxT("%i"), (int)std::ceil( rect.y + bleed)) + - _("-") + wxString::Format(wxT("%i"), (int)std::floor(rect.width)) + - _("-") + wxString::Format(wxT("%i"), (int)std::floor(rect.height)) + - _("-") + wxString::Format(wxT("%i"), degrees) + - _("---"); + return "" + std::to_string((int)std::ceil (rect.x + bleed + img_offset)) + + "-" + std::to_string((int)std::ceil (rect.y + bleed)) + + "-" + std::to_string((int)std::floor(rect.width)) + + "-" + std::to_string((int)std::floor(rect.height)) + + "-" + std::to_string(degrees) + + ""; } /// Does this style have a non-zero size (or is it scripted)? diff --git a/src/data/field/image.cpp b/src/data/field/image.cpp index b2f08127..84a0b121 100644 --- a/src/data/field/image.cpp +++ b/src/data/field/image.cpp @@ -18,17 +18,18 @@ IMPLEMENT_REFLECTION(ImageField) { REFLECT_BASE(Field); } - // ----------------------------------------------------------------------------- : ImageStyle IMPLEMENT_REFLECTION(ImageStyle) { REFLECT_BASE(Style); REFLECT_N("default", default_image); + REFLECT(store_in_metadata); } int ImageStyle::update(Context& ctx) { int changes = Style::update(ctx); changes |= default_image.update(ctx) * CHANGE_DEFAULT; + changes |= store_in_metadata.update(ctx) * CHANGE_OTHER; return changes; } diff --git a/src/data/field/image.hpp b/src/data/field/image.hpp index 686f6a18..0c95d82a 100644 --- a/src/data/field/image.hpp +++ b/src/data/field/image.hpp @@ -10,6 +10,7 @@ #include #include +#include #include