Open aerostitch opened 10 years ago
Since 5989 we support negative values for w and h attributes.
Have not implemented the logic for "90%-100" - like expressions.
It could be possible to do it if we shorten range for possible values. Currently we have 31 bits to express absolute values ranging from -0x40000000 to 0x3fffffff, mapped directly to the same value of u.num and 30 bits to express percent values -0x20000000 to 0x1fffffff, mapped to values of u.num 0x40000000 to 0x7fffffff. So we have unused 30-bit space from -0x40000001 to -0x7fffffff, which could be used to hold two values at the same time, one for absolute value, another for percent one. If we give 20 bits to the signed absolute value part, and 10 bits to sthe signed percent value, we'll be able to represent -524288 to 524287 of absolutes, and -512 to 511 of percents. Looks like sufficient for screen purposes.
Possibly-relative attributes attr_x and attr_y are now also widely [ab]used to hold geographical coordinates, but seem in that case to always be interpreted as absolute values.
Another drawback is rounding errors. If we want to have three osds of 10% width glued by their sides with another item of 70% width, we have to calculate last item width as "whole - 3round(whole10%)" rather than "round(whole*70%)", because of rounding errors. To implement this, i think we'll have to accept arbitrary expression for width/height/coordinates, but it seems to be impossible to fit this into single 32bit integer.
Issue migrated from trac ticket # 1255
component: gui/internal | priority: major
2014-09-28 04:57:49: @mvglasow created the issue