Fallout fdo#83010: wrap on limits also in corner cases

e.g. when spin != 1 and min != 0

Copies the algorithm from now non-existent WrapField widget, it used
to work there ...

Change-Id: Id12f2565f10f272bec4e61737add9c197b674d3b