August 19th, 2002

amused, happy
  • mart

Multiple user layers in a style

It'd be kinda neat if you could have multiple user layers in a single style with a precedence order. Users could then mix and match different kinds of tweaks for different galleries without the “convert user layer to theme” kludge. The S2 backend can handle this already, but the database schema and the interface enforce only one of each kind of layer.

It'd involve adding a field to the style table to number several of the kind of layer so that more than one user layer can be referenced, and the interface would require multiple select boxes where the user can select “None” or any user layer they have up to some arbitrary limit. This clutters the interface, which is a disadvantage.

amused, happy
  • mart

On Floating Point Arithmetic in S2

At the risk of going a little off-topic, I want to push this thought again. The follwing is an email I wrote to Brad in April, which refers to a previous message I wrote where I fixed a bug which would allow fractional numbers to get into S2's integer variables by doing division operations.

Collapse )

While it would mean a lot of search and replace both in the already-existing layers and in the compiler code, I think it'd be good to change S2's numeric datatype to be floating-point now rather than later. The int() call (to obtain the integer part of the number) can be optimised directly onto perl's built in function, and we should also provide a function which rounds to the nearest integer rather than just lopping off the fractional component.