diff dwt/layout/FormAttachment.d @ 187:bcdc37794717

Reverted changes from previous wrong reverting changes: See: -r026ce3b05f57, -r4d06074bb1af, -rc4643827733c
author Frank Benoit <benoit@tionex.de>
date Mon, 10 Mar 2008 17:08:22 +0100
parents 4d06074bb1af
children ab60f3309436
line wrap: on
line diff
--- a/dwt/layout/FormAttachment.d	Mon Mar 10 17:00:00 2008 +0100
+++ b/dwt/layout/FormAttachment.d	Mon Mar 10 17:08:22 2008 +0100
@@ -185,7 +185,7 @@
  * @param offset the offset of the side from the position
  */
 public this (int numerator, int denominator, int offset) {
-    if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
+    if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
     this.numerator = numerator;
     this.denominator = denominator;
     this.offset = offset;
@@ -244,7 +244,7 @@
         m = n;
         n = temp;
     }
-    while (n != 0){
+    while (n !is 0){
         temp = m;
         m = n;
         n = temp % n;
@@ -283,12 +283,12 @@
 }
 
 int solveX (int value) {
-    if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
+    if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
     return ((numerator * value) / denominator) + offset;
 }
 
 int solveY (int value) {
-    if (numerator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
+    if (numerator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO);
     return (value - offset) * denominator / numerator;
 }
 
@@ -298,8 +298,8 @@
  *
  * @return a string representation of the FormAttachment
  */
-override public char[] toString () {
-    char[] string = control != null ? control.toString () : Format( "{}/{}", numerator, denominator );
+public override char[] toString () {
+    char[] string = control !is null ? control.toString () : Format( "{}/{}", numerator, denominator );
     return Format("{{y = ({})x + {}}", string, ( offset >= 0 ? Format(")x + {}", offset ) : Format( ")x - {}", -offset)));
 }