efl_gfx: Use Eina.Rectangle for geometry (EO)
This saves a few lines already (without even having the proper helpers for stack rectangles).
This commit is contained in:
parent
6f259fc2b3
commit
7c352bed15
|
@ -262,7 +262,7 @@ main(void)
|
|||
|
||||
/* Add an image object for 3D scene rendering. */
|
||||
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
|
||||
efl_gfx_geometry_set(image, 0, 0, WIDTH, HEIGHT);
|
||||
efl_gfx_geometry_set(image, (Eina_Rectangle) { 0, 0, WIDTH, HEIGHT });
|
||||
evas_object_show(image);
|
||||
|
||||
/* Set the image object as render target for 3D scene. */
|
||||
|
|
|
@ -70,7 +70,8 @@ _anim_cb(void *data)
|
|||
{
|
||||
App_Data *ad = data;
|
||||
Evas_Object *o;
|
||||
int r, g, b, a, x, y, w, h, f;
|
||||
Eina_Rectangle r;
|
||||
int r, g, b, a, f;
|
||||
int win_w, win_h, mx, my;
|
||||
|
||||
f = ad->frame;
|
||||
|
@ -127,12 +128,12 @@ _anim_cb(void *data)
|
|||
|
||||
|
||||
o = evas_object_name_find(ad->canvas, "obj4");
|
||||
efl_gfx_geometry_get(o, &x, &y, &w, &h);
|
||||
r = efl_gfx_geometry_get(o);
|
||||
efl_gfx_map_reset(o);
|
||||
efl_gfx_map_smooth_set(o, ad->smooth);
|
||||
efl_gfx_map_alpha_set(o, ad->alpha);
|
||||
efl_gfx_map_coord_absolute_set(o, 0, x, y + h, 0);
|
||||
efl_gfx_map_coord_absolute_set(o, 1, x + w, y + h, 0);
|
||||
efl_gfx_map_coord_absolute_set(o, 0, r.x, r.y + r.h, 0);
|
||||
efl_gfx_map_coord_absolute_set(o, 1, r.x + r.w, r.y + r.h, 0);
|
||||
efl_gfx_map_coord_absolute_set(o, 2, win_w - 10, win_h - 30, 0);
|
||||
efl_gfx_map_coord_absolute_set(o, 3, (win_w / 2) + 10, win_h - 30, 0);
|
||||
efl_gfx_map_uv_set(o, 0, 0, 1);
|
||||
|
|
Loading…
Reference in New Issue