added SymbolValueEditor + minor fixes

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@96 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-26 18:51:31 +00:00
parent 8dcda6fd93
commit e2701a646f
19 changed files with 104 additions and 37 deletions
+2 -3
View File
@@ -95,9 +95,8 @@ void DataViewer::setStyles(IndexMap<FieldP,StyleP>& styles) {
(s->width || s->width .isScripted()) &&
(s->height || s->height .isScripted()))) {
// no need to make a viewer for things that are always invisible
viewers.push_back(makeViewer(s));
// REMOVEME //TODO //%%%
if (!viewers.back()) viewers.pop_back();
ValueViewerP viewer = makeViewer(s);
if (viewer) viewers.push_back(viewer);
}
}
// sort viewers by z-index of style
+1 -1
View File
@@ -28,7 +28,7 @@ void filter_symbol(Image& symbol, const SymbolFilter& filter) {
AColor result = filter.color((double)x / width, (double)y / height, point);
// Store color
data[0] = result.Red();
data[2] = result.Green();
data[1] = result.Green();
data[2] = result.Blue();
alpha[0] = result.alpha;
// next
+3 -2
View File
@@ -18,7 +18,8 @@ Image render_symbol(const SymbolP& symbol, double border_radius, int size) {
Bitmap bmp(size, size);
wxMemoryDC dc;
dc.SelectObject(bmp);
clearDC_black(dc);
clearDC(dc, Color(0,128,0));
viewer.rotation.setZoom(size);
viewer.draw(dc);
dc.SelectObject(wxNullBitmap);
return bmp.ConvertToImage();
@@ -28,7 +29,7 @@ Image render_symbol(const SymbolP& symbol, double border_radius, int size) {
SymbolViewer::SymbolViewer(const SymbolP& symbol, double border_radius)
: border_radius(border_radius)
, rotation(0, RealRect(0,0,500,500))
, rotation(0, RealRect(0,0,500,500), 500)
{
setSymbol(symbol);
}
+9 -6
View File
@@ -79,12 +79,15 @@ class ValueViewer {
// ----------------------------------------------------------------------------- : Utility
#define DECLARE_VALUE_VIEWER(Type) \
protected: \
inline Type##Style& style() const { return static_cast< Type##Style&>(*styleP); } \
inline const Type##Value& value() const { return static_cast<const Type##Value&>(*valueP); } \
inline const Type##Field& field() const { return style().field(); } \
public: \
#define DECLARE_VALUE_VIEWER(Type) \
protected: \
inline Type##Style& style() const { return static_cast< Type##Style&>(*ValueViewer::styleP); } \
inline const Type##Value& value() const { return static_cast<const Type##Value&>(*ValueViewer::valueP); } \
inline const Type##Field& field() const { return style().field(); } \
inline Type##StyleP styleP() const { return static_pointer_cast<Type##Style>(ValueViewer::styleP); } \
inline Type##ValueP valueP() const { return static_pointer_cast<Type##Value>(ValueViewer::valueP); } \
inline Type##FieldP fieldP() const { return static_pointer_cast<Type##Field>(style().fieldP); } \
public: \
Type##ValueViewer(DataViewer& parent, const Type ## StyleP& style)