Commits (3)
-
Robert Sprowson authored
Various places in Draw were making an error block (via makmsg or retmsg macros) from a cast pointer using the msg part of RISC_OSLib. However, as RISC_OSLib caches the messages file and returns direct pointers to it, the resulting error blocks would often not be word aligned, leading to an abort when the Wimp tries to copy it for the Wimp_ReportError. In turn, the abort would be reported as unhelpful "wimpt1" message because the signal handler was looking it up in the application messages, not the default RISC_OSLib messages. Draw.c: New function top copy the msg to a word aligned static struct. Fix signal handler to use msgs_default_control_block() so that "wimpt1" can be found. Draw.h/others: Replace makmsg and retmsg with calls to the new aligning function. Tested by dragging a GIF and a BMP to Draw, and it no longer aborts. Version 1.28. Tagged as 'Draw-1_28'
2ab1e96d -
Robert Sprowson authored
Line 114: Remove the potential divide by zero by considering that the only way to get xspace=0 is when yspace <= 1, in which case it's a unity grid. Line 295: Add some brackets to make the expression unambiguous. Fortunately with Norcroft ((thing & 1) == 1) results in the same output as (thing & (1 == 1)) in this situation. From a tip off in https://www.riscosopen.org/forum/forums/4/topics/3990 Version 1.29. Tagged as 'Draw-1_29'
61f4df80 -
Robert Sprowson authored
On starting a new string using the text entry tool, cache the current alphabet, then when backspace is pressed handle deletes properly when the alphabet is UTF-8 by skipping over continuation marks until a non continuation mark is found. The backspace code can afford to be simplistic because any invalid UTF-8 sequences already in the file when it is opened will end up (via Ctrl-E) in a Wimp writeable, which is handled by the Wimp's robust code. Only newly created strings are able to have backspace applied, so by definition they were entered just moments earlier, and so reasonable to assume they're valid UTF-8. Having entered a string, get the bounding box right by calling Font_ScanString rather than manually walking the string with Font_CharBBox (Font_ScanString was already being used for transformed text, so rotated bounding boxes were right). Now the two are common, make a font_scanstring() function to handle both. This could be further simplified...
15e2c31d
Showing