When selecting to the left, the anchor remains to the right of the cursor.
When deleting such a selection, we fetch the cursor and anchor using a helper
method, which ensures that the anchor is to the left of the cursor.
Finally when setting the cursor then to the anchor, we need to also
set the anchor, since both were swapped.
This also add an automated test for this scenario.
Unfortunately something is wrong with the Qt style, it looks like the Qt style
does not respect the rect given for the sub components
Also Input is not handled yet.
Similar to the issue fixed in commit
de74ae4534, clang appears to assume that
the float literal is a double our object literals and aggregate
initialization to float members (like the level of InkLevel) requires an
explicit cast.
I don't know of a way to determine the type of a struct field by index easily,
so this build fix instead uses C++17 destructuring to initialize the fields by index.
So
InkLevel{ std::get<0>(o), std::get<1>(0) }
(^^ fails when get returns double and
field is float)
becomes
InkLevel s; auto& [f1, f2] = s; f1 = std::get<0>(o); f2 = std:get<1>(o); return s;
We really shouldn't require specifying a color for every Text {} element just in order
to see *some* text.
For Rectangle OTOH transparent is a good default (and thus for Color), hence
this change just to Text.
Right now the constructor bit is also a bit repetitive, this could
perhaps be folded into BuiltinItem to generate the ffi, default impl and
forward to an init function if it exists.
The printer demo looks slightly less boring on white background with brighter colors.
In exchange, the controls can become more dull and hopefully easier to see.
Since some lines may produce multiple warnings/errors, the regex
supports now multiple carets, which indicates the number of lines to
walk back. This is a bit hacky, but it works :-)
We decided that their type mapping is not ready for public API yet. For
example for duration we'd like to replace the opaque i64 with another
opaque type that however has convenient conversions to
std::time::Duration or std::chrono::milliseconds. We can't use either
directly because we need ffi compatibility, in order to create an
instance in C++ and pass it to the Rust run-time.
So this hides such properties and instead produces a warning.