Revision: 20089
          http://sourceforge.net/p/jmol/code/20089
Author:   hansonr
Date:     2014-10-28 12:19:23 +0000 (Tue, 28 Oct 2014)
Log Message:
-----------
Jmol.___JmolVersion="14.2.7_2014.10.27"

bug fix: up-arrow in console may not return command if contains unicode
bug fix: antialiasing can subtly change background color

Modified Paths:
--------------
    trunk/Jmol/src/javajs/util/CU.java
    trunk/Jmol/src/javajs/util/PT.java
    trunk/Jmol/src/org/jmol/console/GenericConsole.java
    trunk/Jmol/src/org/jmol/g3d/Graphics3D.java
    trunk/Jmol/src/org/jmol/script/ScriptExpr.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/javajs/util/CU.java
===================================================================
--- trunk/Jmol/src/javajs/util/CU.java  2014-10-28 12:17:36 UTC (rev 20088)
+++ trunk/Jmol/src/javajs/util/CU.java  2014-10-28 12:19:23 UTC (rev 20089)
@@ -441,7 +441,7 @@
   }
 
   public final static P3 colorPtFromString(String colorName, P3 pt) {
-    return toRGBpt(getArgbFromString(colorName), pt);
+    return colorPtFromInt(getArgbFromString(colorName), pt);
   }
 
   public final static P3 colorPtFromInt(int color, P3 pt) {
@@ -501,7 +501,6 @@
   public static P3 rgbToHSL(P3 rgb, boolean doRound) {
     // adapted from http://tips4java.wordpress.com/2009/07/05/hsl-color/
     // see http://en.wikipedia.org/wiki/HSL_color_space
-
     float r = rgb.x / 255;
     float g = rgb.y / 255;
     float b = rgb.z / 255;
@@ -537,10 +536,10 @@
     
     // highly condensed
     
-    float h = hsl.x / 60;
-    float s = hsl.y / 100;
-    float l = hsl.z / 100;
-    
+    float h = Math.max(0,  Math.min(360, hsl.x)) / 60;
+    float s = Math.max(0,  Math.min(100, hsl.y)) / 100;
+    float l = Math.max(0,  Math.min(100, hsl.z)) / 100;
+
     float p = l - (l < 0.5 ? l : 1 - l) * s;    
     float q = 2 * (l - p); 
         

Modified: trunk/Jmol/src/javajs/util/PT.java
===================================================================
--- trunk/Jmol/src/javajs/util/PT.java  2014-10-28 12:17:36 UTC (rev 20088)
+++ trunk/Jmol/src/javajs/util/PT.java  2014-10-28 12:19:23 UTC (rev 20089)
@@ -1032,14 +1032,18 @@
         }
         sb.append(str.substring(pt0, str.length()));
         str = sb.toString();
-      }
-    for (i = str.length(); --i >= 0;)
+      }    
+    return "\"" + escUnicode(str) + "\"";
+  }
+
+  public static String escUnicode(String str) {
+    for (int i = str.length(); --i >= 0;)
       if (str.charAt(i) > 0x7F) {
         String s = "0000" + Integer.toHexString(str.charAt(i));
         str = str.substring(0, i) + "\\u" + s.substring(s.length() - 4)
             + str.substring(i + 1);
       }
-    return "\"" + str + "\"";
+    return str;
   }
 
   /**

Modified: trunk/Jmol/src/org/jmol/console/GenericConsole.java
===================================================================
--- trunk/Jmol/src/org/jmol/console/GenericConsole.java 2014-10-28 12:17:36 UTC 
(rev 20088)
+++ trunk/Jmol/src/org/jmol/console/GenericConsole.java 2014-10-28 12:19:23 UTC 
(rev 20089)
@@ -387,9 +387,8 @@
   
   protected void recallCommand(boolean up) {
     String cmd = vwr.getSetHistory(up ? -1 : 1);
-    if (cmd == null)
-      return;
-    input.setText(cmd);
+    if (cmd != null)
+      input.setText(PT.escUnicode(cmd));
   }
 
   /**
@@ -412,7 +411,7 @@
         if (input.getCaretPosition() == s.length()) {
           String cmd = completeCommand(s);
           if (cmd != null)
-            input.setText(cmd.replace('\t',' '));
+            input.setText(PT.escUnicode(cmd).replace('\t',' '));
           nTab++;
           return mode;
         }

Modified: trunk/Jmol/src/org/jmol/g3d/Graphics3D.java
===================================================================
--- trunk/Jmol/src/org/jmol/g3d/Graphics3D.java 2014-10-28 12:17:36 UTC (rev 
20088)
+++ trunk/Jmol/src/org/jmol/g3d/Graphics3D.java 2014-10-28 12:19:23 UTC (rev 
20089)
@@ -566,6 +566,7 @@
     }
 
   }
+
   private void downsampleFullSceneAntialiasing(boolean downsampleZBuffer) {
     int width4 = width;
     int offset1 = 0;
@@ -573,7 +574,7 @@
     int bgcheck = bgcolor;
     // now is the time we have to put in the correct background color
     // this was a bug in 11.6.0-11.6.2. 
-    
+
     // we must downsample the Z Buffer if there are translucent
     // objects left to draw and antialiasTranslucent is set false
     // in that case we must fudge the background color, because
@@ -581,21 +582,19 @@
     // will put it in the back -- the "blue tie on a blue screen"
     // television effect. We want to avoid that. Here we can do that
     // because the colors will be blurred anyway.
-    
-    if (downsampleZBuffer) {
+
+    if (downsampleZBuffer)
       bgcheck += ((bgcheck & 0xFF) == 0xFF ? -1 : 1);
-    } else {
-    }
-    bgcheck &= 0xFFFFFF;      
+    bgcheck &= 0xFFFFFF;
     for (int i = pbuf.length; --i >= 0;)
       if (pbuf[i] == 0)
         pbuf[i] = bgcheck;
-    int bg0 = ((bgcheck >> 2) & 0x3F3F3F3F)<< 2;
-        bg0 += (bg0 & 0xC0C0C0C0) >> 6;
+    int bg0 = ((bgcheck >> 2) & 0x3F3F3F3F) << 2;
+    bg0 += (bg0 & 0xC0C0C0C0) >> 6;
 
     for (int i = windowHeight; --i >= 0; offset4 += width4)
       for (int j = windowWidth; --j >= 0; ++offset1) {
-        
+
         /* more precise, but of no benefit:
 
         int a = pbuf[offset4];
@@ -608,21 +607,21 @@
            +   (c & 0xF0F0F0) + (d & 0xF0F0F0)
                 ) >> 2);
         */
-        
+
         int argb = ((pbuf[offset4] >> 2) & 0x3F3F3F3F)
-          + ((pbuf[offset4++ + width4] >> 2) & 0x3F3F3F3F)
-          + ((pbuf[offset4] >> 2) & 0x3F3F3F3F)
-          + ((pbuf[offset4++ + width4] >> 2) & 0x3F3F3F3F);
+            + ((pbuf[offset4++ + width4] >> 2) & 0x3F3F3F3F)
+            + ((pbuf[offset4] >> 2) & 0x3F3F3F3F)
+            + ((pbuf[offset4++ + width4] >> 2) & 0x3F3F3F3F);
         argb += (argb & 0xC0C0C0C0) >> 6;
         if (argb == bg0)
           argb = bgcheck;
-      
+
         /**
          * I don't know why this is necessary.
          * 
          * @j2sNative
          * 
-         * this.pbuf[offset1] = argb & 0x00FFFFFF | 0xFF000000;
+         *            this.pbuf[offset1] = argb & 0x00FFFFFF | 0xFF000000;
          */
         {
           pbuf[offset1] = argb & 0x00FFFFFF;
@@ -638,12 +637,11 @@
           z = Math.min(z, zbuf[offset4 + width4]);
           if (z != Integer.MAX_VALUE)
             z >>= 1;
-          zbuf[offset1] = (pbuf[offset1] == bgcheck ? Integer.MAX_VALUE
-              : z);
+          zbuf[offset1] = (pbuf[offset1] == bgcheck ? Integer.MAX_VALUE : z);
         }
       antialiasThisFrame = false;
       setWidthHeight(false);
-    }    
+    }
   }
 
   public boolean hasContent() {

Modified: trunk/Jmol/src/org/jmol/script/ScriptExpr.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptExpr.java      2014-10-28 12:17:36 UTC 
(rev 20088)
+++ trunk/Jmol/src/org/jmol/script/ScriptExpr.java      2014-10-28 12:19:23 UTC 
(rev 20089)
@@ -1801,7 +1801,7 @@
           }
           break;
         case T.color:
-          CU.toRGBpt(vwr.getColorArgbOrGray(bond.colix), ptT);
+          CU.colorPtFromInt(vwr.getColorArgbOrGray(bond.colix), ptT);
           switch (minmaxtype) {
           case T.all:
             vout.addLast(P3.newP(ptT));

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-10-28 12:17:36 UTC 
(rev 20088)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-10-28 12:19:23 UTC 
(rev 20089)
@@ -15,8 +15,11 @@
 TODO: design and implement sidechain mutation -- MUTATE command ?
 TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT 
command for problems)
 
-Jmol.___JmolVersion="14.3.8_2014.10.20"
+Jmol.___JmolVersion="14.3.8_2014.10.27"
 
+bug fix: up-arrow in console may not return command if contains unicode
+bug fix: antialiasing can subtly change background color
+
 bug fix: working on GIF writer -- some success with 256 colors using 
median-cut with RGB
 
 new feature: load HISTORY "saved.his" (Gabor Oszlanyi)
@@ -25,8 +28,6 @@
 new feature: CTRL-PAGE_UP CTRL-PAGE_DOWN in console (Gabor Oszlanyi)
  -- searches for next instance of current start of command up or down command 
history
   
-bug fix: antialiasing can subtly change background color
-
 JmolVersion="14.3.8_2014.10.15b"
 
 bug fix: GIFT (transparent-background GIF) dithering transparent background

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to