Page 1 of 1

native input rect rendering margin?

Posted: Wed Feb 19, 2020 10:31 pm
by slowmaker
When creating an android native input control with mobileControlCreate, it doesn't seem to quite match a graphic rectangle created with the same rect. If you color the graphic you can see more clearly that the native input control is smaller, both width and height.

I tinkered around with a few different dimension sets; the difference seems to be constant, not proportional. Tried fooling around with 'the effective rect', turning border on and off in the rectangle, and so forth (in other stacks, not the basic one attached). No change, there always seems to be that little difference in the size of the input vs the size of the graphic rectangle.

Note that the self-reported rectangles of the input and the graphic do match; checking that was part of the 'and so forth' mentioned above.

Anybody else commented on this somewhere?

Below is what I did to get to this point:

I downloaded the sample stack here from the lesson on responding to the keyboardActivated/Deactivated messages.

Diffs between the original (referenced above) and the attached stack:
  • I changed
    • the rectangle color to red
    • the coordinates so the objects would all be visible on my smaller android screen
  • also, in the standalone settings I changed
    • the signing to 'for development only'
    • the build folder
    • the target from iOS to android
Edit: added screenshot:
Screenshot_20200219-155330.png
Screenshot_20200219-155330.png (8.86 KiB) Viewed 6052 times

Re: native input rect rendering margin?

Posted: Thu Feb 20, 2020 8:18 pm
by slowmaker
attached a stack giving an alternate way to see the issue:

stack graphic rectangles side by side with stacked inputs.
the assigned rectangles for the graphics are the same as the rectangles for the inputs, except for the horizontal translation.
The *rendered* rectangles are visibly different; the graphics stack with no gaps, as expected. The inputs leave a consistent gap.

The gap is both bottom and sides, although the side gap is easier to see in the original post's demo.

Also filed bug report 22585; I'm guessing since nobody has commented then that at least means I haven't missed some glaringly obvious piece of documentation about that margin/padding being expected.

Re: native input rect rendering margin?

Posted: Thu Feb 20, 2020 10:17 pm
by bogs
slowmaker wrote:
Thu Feb 20, 2020 8:18 pm
I'm guessing since nobody has commented then that at least means I haven't missed some glaringly obvious piece of documentation about that margin/padding being expected.
Not necessarily, you did only open this topic yesterday. While I saw it yesterday, and answer quite a lot as time provides, I know less than nothing about mobile peculiarities, so my answering this topic would mean less than nothing.

Others who answer here have different and sometimes quite hectic schedules, or don't hit the forum every day or even every few days. No specific comment in a day long period is hardly surprising. If it went a week or more, then I might assume it is as you said.

Re: native input rect rendering margin?

Posted: Sat Feb 22, 2020 9:10 pm
by jacque
This looks like either the margins property or the linesize property, but in either case it shouldn't change the rect of the graphic. What commands do you use to set the size of the native button? Or are you using the property inspector?

Re: native input rect rendering margin?

Posted: Sun Feb 23, 2020 12:07 am
by slowmaker
jacque wrote:
Sat Feb 22, 2020 9:10 pm
... in either case it shouldn't change the rect of the graphic.
There may be a misunderstanding here on this point; I didn't meant to imply that the rect of the graphic is changed. It is not.
The graphic is just there, assigned the same rect as the input control, so the rendered input control can be seen not covering the area expected.
i.e. the red graphic just helps make the uncovered areas shine through clearly when the input control fails to render throughout its assigned rect.

The code generating the input control is like this:

Code: Select all

local sinputId

on opencard
   if environment() = "mobile" then
      mobileControlCreate "input"
      put the result into sinputID
      mobileControlSet sinputID, "rect", "16,308,400,498"
      mobileControlSet sinputID, "visible", "true"
      mobileControlSet sinputID, "opaque", "true"
   end if
end opencard
The margin and linesize properties sound like decent possibilities; I'll give that a try when I get a chance.

The bug report was confirmed yesterday, so I'm guessing even if the margin property can fix it, then somebody on the team must figure it should have defaulted to zero (and I would agree).

Re: native input rect rendering margin?

Posted: Wed Dec 30, 2020 12:18 am
by Monox18
Were you able to solve the problem? I also saw the bug 22585 you reported and there doesn't seem to be any reply from LC team.

I just started playing around with Android Native Input Widget (from the tools palette, not by script). Also having the same problem when setting the rectangle there's an offset and it doesn't match the assigned rectangle.

Re: native input rect rendering margin?

Posted: Wed Dec 30, 2020 11:55 pm
by slowmaker
The team did reply, in the sense that they changed the status of the bug to "confirmed". But that's it. As of LC 9.6.1, the bug is still there.

I'm guessing it is rare for anyone to align inputs in such a way as to notice this, so it will probably stay extremely low priority for a long while.