//evas_vg_shape_stroke_meter_limit_set(shape, node->mStroke.meterLimit);
}
// update paint info
- if (node->mType == LOTBrushType::BrushSolid) {
+ if (node->mBrushType == LOTBrushType::BrushSolid) {
int r = (node->mColor.r * node->mColor.a)/255;
int g = (node->mColor.g * node->mColor.a)/255;
int b = (node->mColor.b * node->mColor.a)/255;
evas_vg_node_color_set(shape, r, g, b, a);
}
- } else if (node->mType == LOTBrushType::BrushGradient) {
+ } else if (node->mBrushType == LOTBrushType::BrushGradient) {
//TODO fill the gradient info
}
}
GradientRadial
} LOTGradientType;
-typedef struct
+typedef struct LOTGradientStop
{
float pos;
unsigned char r, g, b, a;
-}GradientStop;
+} LOTGradientStop;
typedef struct LOTNode {
struct {
LOTGradientType type;
- GradientStop *stopPtr;
+ LOTGradientStop *stopPtr;
unsigned int stopCount;
struct {
float x, y;
} mGradient;
int mFlag;
- LOTBrushType mType;
+ LOTBrushType mBrushType;
LOTFillRule mFillRule;
} LOTNode;
if (n->mGradient.stopCount)
free(n->mGradient.stopPtr);
n->mGradient.stopCount = grad->mStops.size();
- n->mGradient.stopPtr = (GradientStop *) malloc(n->mGradient.stopCount * sizeof(GradientStop));
+ n->mGradient.stopPtr = (LOTGradientStop *) malloc(n->mGradient.stopCount * sizeof(LOTGradientStop));
}
- GradientStop *ptr = n->mGradient.stopPtr;
+ LOTGradientStop *ptr = n->mGradient.stopPtr;
for (const auto &i : grad->mStops) {
ptr->pos = i.first;
ptr->a = i.second.alpha() * grad->alpha();
switch (mBrush.type()) {
case VBrush::Type::Solid:
- mCNode->mType = LOTBrushType::BrushSolid;
+ mCNode->mBrushType = LOTBrushType::BrushSolid;
mCNode->mColor.r = mBrush.mColor.r;
mCNode->mColor.g = mBrush.mColor.g;
mCNode->mColor.b = mBrush.mColor.b;
mCNode->mColor.a = mBrush.mColor.a;
break;
case VBrush::Type::LinearGradient:
- mCNode->mType = LOTBrushType::BrushGradient;
+ mCNode->mBrushType = LOTBrushType::BrushGradient;
mCNode->mGradient.type = LOTGradientType::GradientLinear;
mCNode->mGradient.start.x = mBrush.mGradient->linear.x1;
mCNode->mGradient.start.y = mBrush.mGradient->linear.y1;
updateGStops(mCNode.get(), mBrush.mGradient);
break;
case VBrush::Type::RadialGradient:
- mCNode->mType = LOTBrushType::BrushGradient;
+ mCNode->mBrushType = LOTBrushType::BrushGradient;
mCNode->mGradient.type = LOTGradientType::GradientRadial;
mCNode->mGradient.center.x = mBrush.mGradient->radial.cx;
mCNode->mGradient.center.y = mBrush.mGradient->radial.cy;