Mercurial > hg > svgui
comparison layer/TextLayer.cpp @ 562:781feeb4d59f
* More on track matching
author | Chris Cannam |
---|---|
date | Tue, 30 Mar 2010 06:29:08 +0000 |
parents | 2e8194a30f40 |
children | f4960f8ce798 |
comparison
equal
deleted
inserted
replaced
561:aced8ec09bc8 | 562:781feeb4d59f |
---|---|
168 for (TextModel::PointList::const_iterator i = onPoints.begin(); | 168 for (TextModel::PointList::const_iterator i = onPoints.begin(); |
169 i != onPoints.end(); ++i) { | 169 i != onPoints.end(); ++i) { |
170 | 170 |
171 int yd = getYForHeight(v, (*i).height) - y; | 171 int yd = getYForHeight(v, (*i).height) - y; |
172 int xd = v->getXForFrame((*i).frame) - x; | 172 int xd = v->getXForFrame((*i).frame) - x; |
173 float distance = sqrt(yd*yd + xd*xd); | 173 float distance = sqrtf(yd*yd + xd*xd); |
174 | 174 |
175 if (nearestDistance == -1 || distance < nearestDistance) { | 175 if (nearestDistance == -1 || distance < nearestDistance) { |
176 nearestDistance = distance; | 176 nearestDistance = distance; |
177 p = *i; | 177 p = *i; |
178 } | 178 } |