From 1b9cb254cc9e8765da1dbdd31c7c5ce42fb03030 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 16 Nov 2008 13:29:17 +0000 Subject: [PATCH] Fix imageMode(CENTER) and image() with only x/y (bug #1013) --- core/src/processing/core/PGraphics.java | 15 ++++++++++++--- core/todo.txt | 19 ++++++++++--------- todo.txt | 6 +++--- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index dce26b9fe..c96da2cde 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -2273,9 +2273,18 @@ public class PGraphics extends PImage implements PConstants { // loadImageAsync() sets width and height to -1 when loading fails. if (image.width == -1 || image.height == -1) return; - imageImpl(image, - x, y, x+image.width, y+image.height, - 0, 0, image.width, image.height); + if (imageMode == CORNER || imageMode == CORNERS) { + imageImpl(image, + x, y, x+image.width, y+image.height, + 0, 0, image.width, image.height); + + } else if (imageMode == CENTER) { + float x1 = x - image.width/2; + float y1 = y - image.height/2; + imageImpl(image, + x1, y1, x1+image.width, y1+image.height, + 0, 0, image.width, image.height); + } } diff --git a/core/todo.txt b/core/todo.txt index 48bbc7705..086483b2f 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,21 +1,22 @@ 0157 core X SVG polygon shapes not drawing since loadShape() and PShape changes X http://dev.processing.org/bugs/show_bug.cgi?id=1005 - -_ image(a, x, y) not honoring imageMode() -_ need to just pass image(a, x, y) to image(a, x, y, a.width, a.height) -_ rather than passing it directly to imageImpl() - -_ No textures render with hint(ENABLE_ACCURATE_TEXTURES) -_ http://dev.processing.org/bugs/show_bug.cgi?id=985 -_ need to remove the hint from the reference -_ need to throw an error when it's used +X image(a, x, y) not honoring imageMode(CENTER) +X need to just pass image(a, x, y) to image(a, x, y, a.width, a.height) +X rather than passing it directly to imageImpl() +X http://dev.processing.org/bugs/show_bug.cgi?id=1013 _ OPENGL sketches flicker w/ Vista when background() is not used inside draw() _ http://dev.processing.org/bugs/show_bug.cgi?id=930 _ Disabling Aero scheme prevents the problem _ Present mode and OPENGL not working in 0156 with Windows Vista _ http://dev.processing.org/bugs/show_bug.cgi?id=1009 +_ -Dsun.java2d.d3d=false seems to fix the problem + +_ No textures render with hint(ENABLE_ACCURATE_TEXTURES) +_ http://dev.processing.org/bugs/show_bug.cgi?id=985 +_ need to remove the hint from the reference +_ need to throw an error when it's used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/todo.txt b/todo.txt index b4ea7588c..a082c93bc 100644 --- a/todo.txt +++ b/todo.txt @@ -1,15 +1,15 @@ 0157 pde X show sketch folder fails for directories containing umlauts X http://dev.processing.org/bugs/show_bug.cgi?id=1010 +X Find in Reference does not open Firefox in 0156 for Linux +X http://dev.processing.org/bugs/show_bug.cgi?id=1012 +_ default font on osx 10.5 is gross _ update to java 6u10 for linux and windows _ update applet.html to point at java 6u10 with the new auto-update stuff _ also update applet on the home page to do the same -_ show sketch folder fails for directories containing umlauts -_ http://dev.processing.org/bugs/show_bug.cgi?id=1010 - _ disallow add file to sketch if it's an example or read-only _ if untitled, and not modified, and closing on macosx (only)