scroller_ = ScrollerCreate();
elm_object_part_content_set(map_, "scroller", scroller_);
+ evas_object_event_callback_add(scroller_, EVAS_CALLBACK_RESIZE, ScrollerResizeCb, this);
evas_object_event_callback_add(scroller_, EVAS_CALLBACK_MOVE, ScrollerResizeCb, this);
}
void WorldClockMap::ScrollerResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
WorldClockMap *view = static_cast<WorldClockMap *>(data);
+
+ evas_object_geometry_get(view->scroller_, &view->mapX, &view->mapY, &view->mapW, &view->mapH);
+ if (view->mapX < 0 || view->mapY < 0 || view->mapW <= 0 || view->mapH <= 0)
+ return;
+
view->MapUpdate();
}
bool WorldClockMap::ShadowCreate(std::tm now, double declination)
{
- evas_object_geometry_get(scroller_, &mapX, &mapY, &mapW, &mapH);
-
- if (mapX < 0 || mapY < 0 || mapW <= 0 || mapH <= 0)
- return false;
- ++mapW; //evas_object_geometry_get returns item's width - 1px
-
for (int i = 0; i < LATITUDE_RESOLUTION_; ++i) {
double time = TimeAngle(90 - i, declination);
evas_object_image_alpha_set(shadow_, EINA_TRUE);
evas_object_show(shadow_);
- evas_object_geometry_set(shadow_, mapX, mapY, mapW, mapH);
evas_object_image_size_set(shadow_, mapW, mapH);
shadow_surface_ = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, mapW, mapH);
evas_object_image_alpha_set(line_, EINA_TRUE);
evas_object_show(line_);
- evas_object_geometry_set(line_, mapX, mapY, mapW, mapH);
evas_object_image_size_set(line_, mapW, mapH);
line_surface_ = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, mapW, mapH);