peacemaker Expert Licensed User Longtime User Apr 28, 2024 #1 HI, All The test project is here: https://www.b4x.com/android/forum/t...bject-moving-dragging-by-_touch-event.160800/ In B4J - the blue horizontal line is visible, but in B4A - no. B4X: Copy mLine = xui.CreatePanel("") mRoot.AddView(mLine, PointSizePx , PointSizePx / 2 - LineThinknessPx, LineLenghtPx, LineThinknessPx) mLine.SetColorAndBorder(LineColor, LineThinknessPx, LineColor, 0) 'line as rectangle between Points Any ideas ?
HI, All The test project is here: https://www.b4x.com/android/forum/t...bject-moving-dragging-by-_touch-event.160800/ In B4J - the blue horizontal line is visible, but in B4A - no. B4X: Copy mLine = xui.CreatePanel("") mRoot.AddView(mLine, PointSizePx , PointSizePx / 2 - LineThinknessPx, LineLenghtPx, LineThinknessPx) mLine.SetColorAndBorder(LineColor, LineThinknessPx, LineColor, 0) 'line as rectangle between Points Any ideas ?
klaus Expert Licensed User Longtime User Apr 28, 2024 #2 You should use dip values here: B4X: Copy Public LineThinknessPx As Int = 2dip Public LineLenghtPx As Int = 20dip Public LineColor As Int = xui.Color_Blue Private PointSizePx As Int = 10dip Upvote 0
You should use dip values here: B4X: Copy Public LineThinknessPx As Int = 2dip Public LineLenghtPx As Int = 20dip Public LineColor As Int = xui.Color_Blue Private PointSizePx As Int = 10dip
peacemaker Expert Licensed User Longtime User Apr 28, 2024 #3 klaus said: dip values Click to expand... Actually, did not help, Klaus Upvote 0
klaus Expert Licensed User Longtime User Apr 28, 2024 #4 And change these two lines: B4X: Copy mRoot.AddView(mLine, PointSizePx , (PointSizePx - LineThinknessPx) / 2, LineLenghtPx, LineThinknessPx) mLine.SetColorAndBorder(LineColor, 0, LineColor, 0) 'line as rectangle between Points Upvote 0
And change these two lines: B4X: Copy mRoot.AddView(mLine, PointSizePx , (PointSizePx - LineThinknessPx) / 2, LineLenghtPx, LineThinknessPx) mLine.SetColorAndBorder(LineColor, 0, LineColor, 0) 'line as rectangle between Points
peacemaker Expert Licensed User Longtime User Apr 28, 2024 #5 klaus said: change these two lines Click to expand... Yes, thanks, Klaus. But also such changes helps to make the pin of correct size: B4X: Copy Public mLine, mPoint1, mPoint2 As B4XView, mRoot As B4XView Public LineThinknessPx As Int = 2dip Public LineLenghtPx As Int = 20dip Public LineColor As Int = xui.Color_Blue Private PointSizePx As Int = LineThinknessPx * 5 'here is important Upvote 0
klaus said: change these two lines Click to expand... Yes, thanks, Klaus. But also such changes helps to make the pin of correct size: B4X: Copy Public mLine, mPoint1, mPoint2 As B4XView, mRoot As B4XView Public LineThinknessPx As Int = 2dip Public LineLenghtPx As Int = 20dip Public LineColor As Int = xui.Color_Blue Private PointSizePx As Int = LineThinknessPx * 5 'here is important