- draw_line(fe, x0, y0, x0, y1, colour);
- draw_line(fe, x0, y1, x1, y1, colour);
- draw_line(fe, x1, y1, x1, y0, colour);
- draw_line(fe, x1, y0, x0, y0, colour);
+ if (pos < w) {
+ *cx = pos; *cy = -1; return;
+ }
+ pos -= w;
+ if (pos < h) {
+ *cx = w; *cy = pos; return;
+ }
+ pos -= h;
+ if (pos < w) {
+ *cx = w-pos-1; *cy = h; return;
+ }
+ pos -= w;
+ if (pos < h) {
+ *cx = -1; *cy = h-pos-1; return;
+ }
+ assert(!"invalid pos, huh?"); /* limited by % above! */
+}
+
+void draw_text_outline(drawing *dr, int x, int y, int fonttype,
+ int fontsize, int align,
+ int text_colour, int outline_colour, char *text)
+{
+ if (outline_colour > -1) {
+ draw_text(dr, x-1, y, fonttype, fontsize, align, outline_colour, text);
+ draw_text(dr, x+1, y, fonttype, fontsize, align, outline_colour, text);
+ draw_text(dr, x, y-1, fonttype, fontsize, align, outline_colour, text);
+ draw_text(dr, x, y+1, fonttype, fontsize, align, outline_colour, text);
+ }
+ draw_text(dr, x, y, fonttype, fontsize, align, text_colour, text);