Fix: Bug with when to do a readyMapCb 10/92810/4
authorVarun <tallytalwar@gmail.com>
Tue, 18 Oct 2016 01:54:08 +0000 (21:54 -0400)
committerVarun <tallytalwar@gmail.com>
Wed, 19 Oct 2016 02:16:06 +0000 (22:16 -0400)
Change-Id: I7aff7bd8a6b791f1b7987e218a9167ed39355572

src/mapzen/tangram_view.cpp

index 6acc2d86ded1b313ecee702e968048ec2998f5f1..51162200ee51572b5934a43afc81165ebfb2056b 100644 (file)
@@ -135,6 +135,10 @@ mapzen_error_e TangramView::create(maps_view_h view, maps_plugin_map_view_ready_
 
        m_map->resize(m_w, m_h);
 
+       if (m_w > 1 && m_h > 1) {
+               readyMapCb((void*)view);
+       }
+
        m_isInitialized = true;
 
        return MAPZEN_ERROR_NONE;
@@ -245,7 +249,7 @@ mapzen_error_e TangramView::render(maps_view_h view, const maps_coordinates_h co
        m_h = MAX(m_h, 1);
 
        if (x != m_x || y != m_y || w != m_w || h != m_h) {
-               if (m_x == 0 && m_y == 0 && x > 0 && y > 0) {
+               if ( (m_w <= 1 || m_h <= 1) && w > 1 && h > 1) {
                        // Send a tangram view ready callback when we have a legit canvas size
                        readyMapCb((void*)view);
                }