From f0a15916b60617ca98379a659e042ced38a1f304 Mon Sep 17 00:00:00 2001 From: James Cryer Date: Tue, 19 Feb 2013 14:56:07 +0000 Subject: [PATCH] I think antialising is working --- demoassets/main.js | 29 +++- index.html | 7 + resemble.js | 335 ++++++++++++++++++++++++++++++++++++++------- 3 files changed, 320 insertions(+), 51 deletions(-) diff --git a/demoassets/main.js b/demoassets/main.js index 0d7a5fc..7463927 100644 --- a/demoassets/main.js +++ b/demoassets/main.js @@ -58,6 +58,8 @@ $(function(){ window.open(diffImage.src, '_blank'); }); + $('#button').show(); + if(data.misMatchPercentage == 0){ $('#thesame').show(); $('#diff-results').hide(); @@ -75,16 +77,39 @@ $(function(){ var file1; var file2; + var resembleControl; dropZone($('#dropzone1'), function(file){ file1 = file; if(file2){ - resemble(file).compareTo(file2).onComplete(onComplete); + resembleControl = resemble(file).compareTo(file2).onComplete(onComplete); } }); dropZone($('#dropzone2'), function(file){ file2 = file; if(file1){ - resemble(file).compareTo(file1).onComplete(onComplete); + resembleControl = resemble(file).compareTo(file1).onComplete(onComplete); + } + }); + + + var buttons = $('#raw, #colors, #antialising'); + + buttons.click(function(){ + var $this = $(this); + + buttons.removeClass('active'); + $this.addClass('active'); + + if($this.is('#raw')){ + resembleControl.ignoreNothing(); + } + else + if($this.is('#colors')){ + resembleControl.ignoreColors(); + } + else + if($this.is('#antialising')){ + resembleControl.ignoreAntialiasing(); } }); diff --git a/index.html b/index.html index 6547c52..4c27892 100644 --- a/index.html +++ b/index.html @@ -81,6 +81,13 @@ Diff will appear here.
+
+ + + +
+
+