OK it looks good to me. That said, I haven't really checked the code for years. I'd wait to commit until Paul had his say.
Johnf
On 04/22/2014 09:21 AM, Werner wrote:
Hi John,

Lets try it with values, as this is giving me grey hairs.

My page is A4, it has four columns of labels which are 45.7 x 25.4 mm, column spacing is 2.5 mm and left and right margin is 10 mm

with the current code this means:

columnPadding = self._columnPadding = self.getPt(_form.getProp("columnPadding")) * (columnCount - 1)
2.5 * 3 = 7.5

and the result of:

columnWidth = self._columnWidth = \
((self._pageWidth - self._ml - self._mr) / self._columnCount) - (.5 * self._columnPadding)

(210 - 10 - 10) / 4 - (0.5 * 7.5) = 43.25

if columnPadding where 2.5 then we would get:
(210 - 10 - 10) / 4 - (0.5 * 2.5) = 45.75

So, your where right my first proposal for the new code was wrong, it should be (just one line change):

columnPadding = self._columnPadding = self.getPt(_form.getProp("columnPadding"))
        columnWidth = self._columnWidth = \
((self._pageWidth - self._ml - self._mr) / self._columnCount) - (.5 * self._columnPadding)

I don't see that we need a variable for 'totalPadding'.

With above my labels work if I define the column padding as 2.5 mm.

Werner
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/535696f8.3020...@gmx.ch

_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/5356ce7a.3020...@jfcomputer.com

Reply via email to