EFL_CANVAS_VG_COMPUTE_MATRIX(cTransform, pTransform, nd);
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ if (nd->m_geometric)
+ {
+ if (cTransform) eina_matrix3_compose(nd->m_geometric, cTransform, cTransform);
+ else cTransform = nd->m_geometric;
+ }
+
EINA_LIST_FOREACH(cd->children, l, child)
{
Efl_Canvas_Vg_Node_Data *cnd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS);
trans_mat.e23 += nd->y;
tvg_paint_set_transform(pd->picture, &trans_mat);
}
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ if (nd->w_geometric > 0 || nd->h_geometric > 0) tvg_picture_set_size(pd->picture, nd->w_geometric, nd->h_geometric);
efl_gfx_color_get(obj, NULL, NULL, NULL, &alpha);
EFL_CANVAS_VG_COMPUTE_ALPHA(c_r, c_g, c_b, c_a, alpha, nd);
efl_canvas_vg_object_change(nd->vd);
}
+// TIZEN_ONLY(20220330): evas: proper image scaling
+static void
+_efl_canvas_vg_node_geometric_data_set(Eo *obj,
+ Efl_Canvas_Vg_Node_Data *pd,
+ const Eina_Matrix3 *m,
+ double w,
+ double h)
+{
+ if (pd->intp)
+ {
+ free(pd->intp);
+ pd->intp = NULL;
+ }
+
+ if (m)
+ {
+ if (!pd->m_geometric)
+ {
+ pd->m_geometric = malloc(sizeof (Eina_Matrix3));
+ if (!pd->m_geometric) return;
+ }
+ memcpy(pd->m_geometric, m, sizeof (Eina_Matrix3));
+ }
+ else
+ {
+ free(pd->m_geometric);
+ pd->m_geometric = NULL;
+ }
+
+ pd->w_geometric = w;
+ pd->h_geometric = h;
+
+ /* NOTE: _node_change function is only executed
+ when pd->flags is EFL_GFX_CHANGE_FLAG_NONE to prevent duplicate calls.*/
+ _node_change(obj, pd);
+ pd->flags |= EFL_GFX_CHANGE_FLAG_MATRIX;
+}
+
+
static void
_efl_canvas_vg_node_transformation_set(Eo *obj,
Efl_Canvas_Vg_Node_Data *pd,
free(pd->m);
pd->m = NULL;
}
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ if (pd->m_geometric)
+ {
+ free(pd->m_geometric);
+ pd->m_geometric = NULL;
+ }
if (pd->intp)
{
free(pd->intp);
nd->m = malloc(sizeof(Eina_Matrix3));
if (nd->m) memcpy(nd->m, pd->m, sizeof(Eina_Matrix3));
}
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ if (pd->m_geometric)
+ {
+ nd->m_geometric = malloc(sizeof(Eina_Matrix3));
+ if (nd->m_geometric) memcpy(nd->m_geometric, pd->m_geometric, sizeof(Eina_Matrix3));
+ }
+ nd->w_geometric = pd->w_geometric;
+ nd->h_geometric = pd->h_geometric;
nd->x = pd->x;
nd->y = pd->y;
nd->r = pd->r;
{
[[Efl vector graphics abstract class]]
methods {
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ @property geometric_data {
+ [[The transformation matrix, the width and the height of the node object in case it was cached.
+
+ Note: Pass $null to cancel the applied transformation matrix.
+ ]]
+ set {
+ }
+ values {
+ m: ptr(const(Eina.Matrix3)); [[Transformation matrix.]]
+ w: double; [[Width of the node object.]]
+ h: double; [[Height of the node object.]]
+ }
+ }
@property transformation {
[[The transformation matrix to be used for this node object.
int r, g, b, a;
Efl_Gfx_Change_Flag flags;
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ double w_geometric, h_geometric;
+ Eina_Matrix3 *m_geometric;
+
Eina_Bool visibility : 1;
};
eina_matrix3_scale(&m, sx, sy);
eina_matrix3_translate(&m, -vfd->view_box.x, -vfd->view_box.y);
}
- efl_canvas_vg_node_transformation_set(root, &m);
+ // TIZEN_ONLY(20220330): evas: proper image scaling
+ efl_canvas_vg_node_geometric_data_set(root, &m, w, h);
}
void