Workaround for React Native flexbox algorithm — boxes not stretching based on text height - flexbox

I want to implement something like this with React Native:
... notice how the grey line must run through top to bottom; the height of the 'row' is dictated by the amount of text there is in that step.
This is what I did:
Let's build the circular image node. You can see this running at https://rnplay.org/apps/NRZAFg. So far so good. I've marked the underlying container (which I'll call lhsContainer) with light red. The container flexes to fill the whole row.
Okay, let's try making sure the grey lines flex to fill to both the top and bottom of lhsContainer. Easy: I just add height: 100 to the view that contains it (styles.container). This works fine:
Next, incorporating the text. I want the height of the row (and therefore lhsContainer) to be given by the text. This DOESN'T work fine. The grey line doesn't flex to the bottom of the container! :
Autolayout would have done the right thing here (being a fancy-pantsy constraint solver), but FlexBox doesn't. (You can see this for yourself by uncommenting the code in the playground app).
I believe using row-reverse would be one way to resolve this, but sadly React Native doesn't support it yet.
What's the workaround for this?

Related

Unknown empty space in layout, how to remove it?

I have simple grid layout. 3 columns, 3 rows. Rows are set 400px 400px 100px just for demo.My monitor resolution is 1920x1080 (doesn't matter). On main page there won't content just informations. I'd like remove the empty space under the grid, cuz there is no reason for. I dont know how. It makes my other parts buggy. For better understanding i insert image below.
I checked also <body> but it's not this case.
There is no way to delete it
This is the default HTML and cannot be done unless you override it with an object or change the background color so that it is not white.

Can you hide a node when not directly above a parent in Godot?

So I have an instanced scene that is supposed to be the child of a colour rect in my tree. I want to randomly generate the nodes, but I also want parts of the view to be cut off if the texture no longer is above the main section. I know you can render nodes below their parents, but I don't know if stopping part of them from rendering is physically possible.
In this image I want the bottom circle to remain the same, but the top circle to not show anything above the dark purple box
This is the node tree in the editor
Is there any way to do this directly, or am I gonna have to use a viewport of some variety?
I believe what you want is to set rect_clip_content to true on the ColorRect (or whatever Control). Making invisible any part of its children outside of it.
From Godot's documentation:
bool rect_clip_content
Enables whether rendering of CanvasItem based children should be clipped to this control's rectangle. If true, parts of a child which would be visibly outside of this control's rectangle will not be rendered.
If what you want is the opposite, perhaps you can use z_index to have something render on top, occluding the parts you don't want visible.
There is also a trick you can use with lights (including 2D lights):
Make a light that matches the area you want things to be visible.
Set a custom material that will be transparent by default, but visible on the light pass. The simpler way to do this is to set the light_mode of the material to "Light Only". You could also do it with a custom shader instead.
Making something disappear with light, in 2D, is impossible. In 3D, you can use flags_use_shadow_to_opacity. That is how you make a shadow catcher.
But, there is one more trick: you can use a mask. This should give you full control of when to show or hide things. So, if none of the above solutions works for you, use a mask. I have an explanation in a different answer. See also: How to crop sprite in a non-rectangular form?.
Mighty Mochi Games recently (2022-03-30) made a compilation of the different approaches in video form: Mask Methods Collection - Godot 3.x - 2D
.

Bottom bar shape without programming

I'm trying to make something like this:
But I don't know how to make the central part.
I know that it can be made programming because others did it (with bézier curves or Canvas), but I'd like to make it with a drawable, an image or SVG (so, without Java code). I can't use any external libraries.
The white part must be transparent, so I can't add a white circle at the bottom of the '+' button.
Currently I have a Constraint Layout, with 2 LinearLayout with background color:
After some searching I found that material.io had the exact same design as an example:
So I just followed the provided code tutorial.

Tabulator - Layout Options

If I set my table to use the layout "fitDataTable" I get the following
This is what I expect and find.
However, if I set the layout to "fitDataStretch" keeping everything else the same I get the following
Its good that it now fits the width how I want, however notice the big gap at the bottom and the way it's not showing all the rows.
Stranger still if I try setting the table height I get the following (redraw() seems to do nothing)
Notice still it still doesnt show all the data but also the header seems to have stretched
Since the containing element is exactly the same, all I am changing is the layout when creating the table, im struggling to find out why the layout looks broken, I can only assume that when Tabulator creates the table it doesnt like something on the containing element, but if you have any pointers between the differences in how the two layouts work I would apriciate it.
Certain layouts in Tabulator don't seem to play nice if the containing element has CSS display: grid -it was possible for me to change to display: block and everything worked as expected. Also, see the comment from #oli Folkerd

SVG gradient not applied on MS Edge in Aurelia application

I am building an AureliaJS based application which contains a SVG based component. My problem is that in MS Edge, the gradients of this SVG are not rendered (see image below: the "gauge" is supposed to be transparent and the two circles green). It is correctly displayed in all the other browsers I tested (FireFox, IE11, Chrome).
The gradients are defined inside the SVG in a defs section. They are then used by their ids.
I tried:
To open the SVG part of the component as an SVG file in Edge. Strangely it renders correctly. So I guess the SVG is correct.
To remove the Aurelia markup: the problem is still here.
To change the value of fill (currently fill: url(#gauge-fill-2)) into fill: url('#gauge-fill-2') or fill: url('/#gauge-fill-2') without success.
I also get the message below in the console, which disappears if I remove this SVG (I translated it from French as I have a French edition of Windows 10)
XML5633: The name of the ending tag doesn't match the name of the starting tag.
Line. 60, column 7
However, when I read the code, I couldn't find any problem about closing tags. To be sure of this, I remove most of the code and left only one element with a gradient on it. This message was still there.
The full code of the component is available here: https://bitbucket.org/arenaoftitans/arena-of-titans/src/9f5f70ff3fc71832bcac90ce0dcc5204a471b095/app/game/play/widgets/gauge/gauge.html?at=master&fileviewer=file-view-default
Any idea of what the problem might be and how to solve it?
The problem is solved by the creators update. I just need for it to be widely deployed.

Resources