Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8430

Re: PowerBuilder adjusting widths and x-position after rendering

$
0
0

I noticed this is due to PB Units -> Pixel conversion. For example if I set an object at x value 24, somewhere PB will convert that to the pixel value which is 5, then back to it's PB value which is 23. So I lose a PB unit since it doesn't take decimal values into consideration.

 

Noticed this by simply testing:

 

int li_pixelValue, li_pbValue

 

li_pixelValue = UnitsToPixels(24, XUnitsToPixels!) // pixelValue will be 5

li_pbValue = PixelsToUnits(li_pixelValue , XPixelsToUnits!) // Converting back gives 23.


This is also easy to test just by creating a datawindow and place something at X = 24. At least for me it adjusts to 23 after deselecting and selecting the element again.


So this is really a problem for me since I create a lot of objects that I wanted perfectly aligned with eachother.


Do anyone know the UnitsToPixels alghoritm so I might be able to save the decimal precision that is lost to compensate for in my layouts?


Viewing all articles
Browse latest Browse all 8430

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>