@@ -709,7 +709,7 @@ tilecache_print(Tilecache *tilecache)
709709
710710static void
711711tilecache_compute_visibility (Tilecache * tilecache ,
712- graphene_rect_t * grect , int z )
712+ VipsRect * viewport , int z )
713713{
714714 int size0 = TILE_SIZE << z ;
715715 int start_time = tile_get_time ();
@@ -727,10 +727,8 @@ tilecache_compute_visibility(Tilecache *tilecache,
727727
728728 /* The rect of tiles touched by the viewport.
729729 */
730- VipsRect viewport ;
731- rect_graphene_to_vips (grect , & viewport );
732730 VipsRect touches ;
733- tilecache_tiles_for_rect (tilecache , & viewport , z , & touches );
731+ tilecache_tiles_for_rect (tilecache , viewport , z , & touches );
734732
735733#ifdef DEBUG_VERBOSE
736734 printf ("viewport in level0 coordinates: left = %d, top = %d, "
@@ -907,18 +905,16 @@ tilecache_snapshot(Tilecache *tilecache, GtkSnapshot *snapshot,
907905
908906 /* paint_rect in level0 coordinates.
909907 */
910- graphene_rect_t viewport ;
911- viewport .origin . x = x / scale ;
912- viewport .origin . y = y / scale ;
913- viewport .size . width = VIPS_MAX (1 , paint -> size .width / scale );
914- viewport .size . height = VIPS_MAX (1 , paint -> size .height / scale );
908+ VipsRect viewport ;
909+ viewport .left = floorf ( x / scale ) ;
910+ viewport .top = floorf ( y / scale ) ;
911+ viewport .width = VIPS_MAX (1 , ceilf ( paint -> size .width / scale ) );
912+ viewport .height = VIPS_MAX (1 , ceilf ( paint -> size .height / scale ) );
915913
916914 /* Fetch any tiles we are missing, update any tiles we have that have
917915 * been flagged as having pixels ready for fetching.
918916 */
919- VipsRect bounds ;
920- tilecache_request_area (tilecache ,
921- rect_graphene_to_vips (& viewport , & bounds ), z );
917+ tilecache_request_area (tilecache , & viewport , z );
922918
923919 /* Find the set of visible tiles, sorted back to front.
924920 *
@@ -987,10 +983,10 @@ tilecache_snapshot(Tilecache *tilecache, GtkSnapshot *snapshot,
987983
988984 gsk_rounded_rect_init_from_rect (& outline ,
989985 & GRAPHENE_RECT_INIT (
990- viewport .origin . x * scale - x + paint -> origin .x ,
991- viewport .origin . y * scale - y + paint -> origin .y ,
992- viewport .size . width * scale ,
993- viewport .size . height * scale ),
986+ viewport .left * scale - x + paint -> origin .x ,
987+ viewport .top * scale - y + paint -> origin .y ,
988+ viewport .width * scale ,
989+ viewport .height * scale ),
994990 0 );
995991
996992 gtk_snapshot_append_border (snapshot ,
0 commit comments