I am developing an app to keep track of wines in my wine fridge and have noticed an anomaly when running it in Release mode as opposed to Debug mode. I have a graphical representation of my fridge which has 12 shelves and 8 bottle positions per shelf - 4 bottles with their bottoms showing and 4 with their tops showing. I am adding the views within a For loop as below and want to have the images of tops of the bottles smaller than the bottoms.
When I run this in debug I get the image in s1.jpg which is correct but when I run in release mode I get a different result as in s2.jpg. Any ideas why this is happening?
B4X:
curtop = 0
Dim front As Boolean = True
Dim mult, offset As Double
viewno = numshelves
For i = 1 To numshelves
curleft = 10dip
For j = 1 To numpositions
Dim bottle As Button
bottle.Initialize("bottle")
bottle.Background = empty
bottle.Tag = i & ":0:" & j & ":" & viewno & ":empty"
If front Then
mult = 1 : offset = 0
front = False
Else
mult = .6 : offset = bottlewidth*.2
front = True
End If
pnlFridge.AddView(bottle, curleft, curtop + offset, bottlewidth*mult, bottlewidth*mult)
curleft = curleft + bottlewidth + bottlegap
viewno = viewno + 1
Next
curleft = 10dip
curtop = curtop + shelfheight + shelfgap
Next
When I run this in debug I get the image in s1.jpg which is correct but when I run in release mode I get a different result as in s2.jpg. Any ideas why this is happening?