changeset 750:0f34d430a80b

merge with main
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 11 Jan 2009 17:03:51 +0100
parents cd56f9fc951d (current diff) 8f7293125059 (diff)
children a4dfe2cebc7c
files
diffstat 3 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/dpi/datauri.c	Sat Jan 10 16:11:57 2009 +0100
+++ b/dpi/datauri.c	Sun Jan 11 17:03:51 2009 +0100
@@ -22,8 +22,13 @@
 /*
  * Debugging macros
  */
+#define SILENT 1
 #define _MSG(...)
-#define MSG(...)  printf("[datauri dpi]: " __VA_ARGS__)
+#if SILENT
+ #define MSG(...)
+#else
+ #define MSG(...)  fprintf(stderr, "[datauri dpi]: " __VA_ARGS__)
+#endif
 
 /*
  * Global variables
--- a/dpi/https.c	Sat Jan 10 16:11:57 2009 +0100
+++ b/dpi/https.c	Sun Jan 11 17:03:51 2009 +0100
@@ -64,8 +64,13 @@
 /*
  * Debugging macros
  */
+#define SILENT 1
 #define _MSG(...)
-#define MSG(...)  printf("[https dpi]: " __VA_ARGS__)
+#if SILENT
+ #define MSG(...)
+#else
+ #define MSG(...)  fprintf(stderr, "[https dpi]: " __VA_ARGS__)
+#endif
 
 
 #ifdef ENABLE_SSL
--- a/dw/image.cc	Sat Jan 10 16:11:57 2009 +0100
+++ b/dw/image.cc	Sun Jan 11 17:03:51 2009 +0100
@@ -207,10 +207,9 @@
           " = %d - %d = %d\n", this->getHeight(), getStyle()->boxDiffHeight(),
           this->getHeight() - getStyle()->boxDiffHeight());
 #endif
-   if (buffer != NULL &&
-       /* It may be, that the image is allocated at zero content size. In this
-        * case, we simply wait. */
-       getContentWidth () > 0 && getContentHeight () > 0) {
+   if (buffer && (getContentWidth () > 0 || getContentHeight () > 0)) {
+      // Zero content size : simply wait...
+      // Only one dimension: naturally scale
       oldBuffer = buffer;
       buffer = oldBuffer->getScaledBuf (allocation->width - dx,
                                         allocation->ascent
@@ -355,11 +354,10 @@
    if (resize)
       queueResize (0, true);
 
-   // If the image has not yet been allocated, or is allocated at zero
-   // content size, the first part is useless.
    if (wasAllocated () && getContentWidth () > 0 && getContentHeight () > 0) {
-         this->buffer =
-            buffer->getScaledBuf (getContentWidth (), getContentHeight ());
+      // Only scale when both dimensions are known.
+      this->buffer =
+         buffer->getScaledBuf (getContentWidth (), getContentHeight ());
    } else {
       this->buffer = buffer;
       buffer->ref ();