localPointToGlobal Overload Request


#1

Hi Jules,

Would you mind adding a convenience method for Component? It would save lots of pointless typing.

Point<int> Component::localPointToGlobal (const int x, const int y) const
{
    return ComponentHelpers::convertCoordinate (nullptr, this, Point<int>(x, y));
}

#2

Well… no, not keen on that… I’ve been trying hard to avoid raw coordinates where possible, and to encourage the use of Point.

If you’re finding such a small thing enough of a hassle to post about it, then you must be calling localPointToGlobal a whole lot of times… and whenever you find yourself calling the same function many times, that’s generally means there’s a “repeated code” smell going on… Might be a good idea to look at refactoring your code, maybe wrapping the method call in your own function to remove some of the repeated code.


#3

Had a feeling you were gonna say “refactor”! Fair 'nuff