Code

Store cached icons to disk between runs, and invalidate/purge as needed.
[inkscape.git] / src / color.h
index 4fcffad8e121e8eeaeeb30e5d7fb7b7755ff3e88..bebeaec60b4e188bb2dbe7ae8514c6fbb8858b01 100644 (file)
@@ -25,7 +25,7 @@
 #define SP_RGBA32_B_U(v) (((v) >> 8) & 0xff)
 #define SP_RGBA32_A_U(v) ((v) & 0xff)
 #define SP_COLOR_U_TO_F(v) ((v) / 255.0)
-#define SP_COLOR_F_TO_U(v) ((unsigned int) ((v) * 255.9999))
+#define SP_COLOR_F_TO_U(v) ((unsigned int) ((v) * 255. + .5))
 #define SP_RGBA32_R_F(v) SP_COLOR_U_TO_F (SP_RGBA32_R_U (v))
 #define SP_RGBA32_G_F(v) SP_COLOR_U_TO_F (SP_RGBA32_G_U (v))
 #define SP_RGBA32_B_F(v) SP_COLOR_U_TO_F (SP_RGBA32_B_U (v))
@@ -43,7 +43,7 @@ struct SPColor {
     SPColor( SPColor const& other );
     SPColor( float r, float g, float b );
     SPColor( guint32 value );
-    ~SPColor();
+    virtual ~SPColor();
 
     SPColor& operator= (SPColor const& other);