From 96747b1c435104f3a165400a820d286cb0007a16 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Tue, 14 Aug 2018 16:38:39 -0400 Subject: [PATCH 1/2] Remove unused testing code --- CMakeLists.txt | 16 ----------- tests/runners/geojs_test_runner.py.in | 39 --------------------------- 2 files changed, 55 deletions(-) delete mode 100644 tests/runners/geojs_test_runner.py.in diff --git a/CMakeLists.txt b/CMakeLists.txt index bd4663be76..6d0bd2afb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,22 +29,6 @@ if(NOT NPM_EXECUTABLE) message(FATAL_ERROR "npm is required for many tests") endif() -function(add_geojs_test test_name) - add_test( - NAME "${test_name}" - WORKING_DIRECTORY "${GEOJS_DEPLOY_DIR}" - COMMAND ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_BINARY_DIR}/test/geojs_test_runner.py - ${ARGN} - ) - set_property(TEST "${test_name}" APPEND PROPERTY DEPENDS "notes-reset") - set_property(TEST "notes-report" APPEND PROPERTY DEPENDS "${test_name}") -endfunction() - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/runners/geojs_test_runner.py.in - ${CMAKE_CURRENT_BINARY_DIR}/test/geojs_test_runner.py -) - # Generate notes to send along with the test reports add_test( NAME "notes-reset" diff --git a/tests/runners/geojs_test_runner.py.in b/tests/runners/geojs_test_runner.py.in deleted file mode 100644 index b61dd86b4a..0000000000 --- a/tests/runners/geojs_test_runner.py.in +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python - -import time -import sys -import os -import subprocess -import threading - -if sys.version_info[0] == 2: - import SocketServer - import SimpleHTTPServer -elif sys.version_info[0] == 3: - import socketserver as SocketServer - from http import server as SimpleHTTPServer -else: - raise Exception("Unsupported python version") - -HTTPHandler = SimpleHTTPServer.SimpleHTTPRequestHandler - - -DEPLOY_PATH = "@GEOJS_DEPLOY_DIR@" -HOST = "@TESTING_HOST@" -PORT = @TESTING_PORT@ -server = None - - -def main(): - status = 0 - if len(sys.argv[1:]): - status = 1 - try: - status = subprocess.call(sys.argv[1:]) - except Exception: - pass - - return status - -if __name__ == "__main__": - sys.exit(main()) From 3b2ca7d15ae4313102a70315e657f0e05db8b977 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 21 Aug 2018 09:29:22 -0400 Subject: [PATCH 2/2] When tiles have overlap, rendering cropped tiles could throw an error. This happened on IE11. By ensuring we don't ask to crop to a size larger than the image, it works properly. --- src/canvas/quadFeature.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/canvas/quadFeature.js b/src/canvas/quadFeature.js index 37fd20e89e..fa8c07e522 100644 --- a/src/canvas/quadFeature.js +++ b/src/canvas/quadFeature.js @@ -174,8 +174,11 @@ var canvas_quadFeature = function (arg) { if (!quad.crop) { context2d.drawImage(src, 0, 0); } else { - context2d.drawImage(src, 0, 0, quad.crop.x, quad.crop.y, 0, 0, - quad.crop.x, quad.crop.y); + var cropx = Math.min(src.w, quad.crop.x), + cropy = Math.min(src.h, quad.crop.y); + if (cropx > 0 && cropy > 0) { + context2d.drawImage(src, 0, 0, cropx, cropy, 0, 0, cropx, cropy); + } } }); });