comparison qt/d1/qt/core/QPoint.d @ 231:99e74c8a22f8

change ref to in in structs
author eldar
date Fri, 17 Jul 2009 21:16:44 +0000
parents 7dd099050621
children 7664de4a55e5
comparison
equal deleted inserted replaced
230:0c2a27b23238 231:99e74c8a22f8
51 51
52 inline int &ry() 52 inline int &ry()
53 { return yp; } 53 { return yp; }
54 */ 54 */
55 55
56 QPoint opAddAssign(ref QPoint p) 56 QPoint opAddAssign(in QPoint p)
57 { xp+=p.xp; yp+=p.yp; return *this; } 57 { xp+=p.xp; yp+=p.yp; return *this; }
58 58
59 QPoint opSubAssign(ref QPoint p) 59 QPoint opSubAssign(in QPoint p)
60 { xp-=p.xp; yp-=p.yp; return *this; } 60 { xp-=p.xp; yp-=p.yp; return *this; }
61 61
62 QPoint opMulAssign(qreal c) 62 QPoint opMulAssign(qreal c)
63 { xp = qRound(xp*c); yp = qRound(yp*c); return *this; } 63 { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
64 64
65 bool opEquals(ref QPoint p) 65 bool opEquals(in QPoint p)
66 { return xp == p.xp && yp == p.yp; } 66 { return xp == p.xp && yp == p.yp; }
67 67
68 QPoint opAdd(ref QPoint p) 68 QPoint opAdd(in QPoint p)
69 { return QPoint(this.xp+p.xp, this.yp+p.yp); } 69 { return QPoint(this.xp+p.xp, this.yp+p.yp); }
70 70
71 QPoint opSub(ref QPoint p) 71 QPoint opSub(in QPoint p)
72 { return QPoint(this.xp-p.xp, this.yp-p.yp); } 72 { return QPoint(this.xp-p.xp, this.yp-p.yp); }
73 73
74 QPoint opMul(qreal c) 74 QPoint opMul(qreal c)
75 { return QPoint(qRound(this.xp*c), qRound(this.yp*c)); } 75 { return QPoint(qRound(this.xp*c), qRound(this.yp*c)); }
76 76
122 pt.xp = xpos; 122 pt.xp = xpos;
123 pt.yp = ypos; 123 pt.yp = ypos;
124 return pt; 124 return pt;
125 } 125 }
126 126
127 public static QPointF opCall(ref QPoint p) { 127 public static QPointF opCall(in QPoint p) {
128 QPointF pt; 128 QPointF pt;
129 pt.xp = p.x(); 129 pt.xp = p.x();
130 pt.yp = p.y(); 130 pt.yp = p.y();
131 return pt; 131 return pt;
132 } 132 }
165 { 165 {
166 return yp; 166 return yp;
167 } 167 }
168 */ 168 */
169 169
170 QPointF opAddAssign(ref QPointF p) 170 QPointF opAddAssign(in QPointF p)
171 { xp+=p.xp; yp+=p.yp; return *this; } 171 { xp+=p.xp; yp+=p.yp; return *this; }
172 172
173 QPointF opSubAssign(ref QPointF p) 173 QPointF opSubAssign(in QPointF p)
174 { xp-=p.xp; yp-=p.yp; return *this; } 174 { xp-=p.xp; yp-=p.yp; return *this; }
175 175
176 QPointF opMulAssign(qreal c) 176 QPointF opMulAssign(qreal c)
177 { xp*=c; yp*=c; return *this; } 177 { xp*=c; yp*=c; return *this; }
178 178
179 bool opEquals(ref QPointF p) 179 bool opEquals(in QPointF p)
180 { return qFuzzyCompare(xp, p.xp) && qFuzzyCompare(yp, p.yp); } 180 { return qFuzzyCompare(xp, p.xp) && qFuzzyCompare(yp, p.yp); }
181 181
182 QPointF opAdd(ref QPointF p) 182 QPointF opAdd(in QPointF p)
183 { return QPointF(this.xp+p.xp, this.yp+p.yp); } 183 { return QPointF(this.xp+p.xp, this.yp+p.yp); }
184 184
185 QPointF opSub(ref QPointF p) 185 QPointF opSub(in QPointF p)
186 { return QPointF(this.xp-p.xp, this.yp-p.yp); } 186 { return QPointF(this.xp-p.xp, this.yp-p.yp); }
187 187
188 QPointF opMul(qreal c) 188 QPointF opMul(qreal c)
189 { return QPointF(this.xp*c, this.yp*c); } 189 { return QPointF(this.xp*c, this.yp*c); }
190 190