static gboolean textobj_transform(Textobj *textobj, const DiaMatrix *m) { real a, sx, sy; g_return_val_if_fail(m != NULL, FALSE); if (!dia_matrix_get_angle_and_scales (m, &a, &sx, &sy)) { dia_log_message ("textobj_transform() can't convert given matrix"); return FALSE; } else { /* XXX: what to do if width!=height */ real height = text_get_height (textobj->text) * MIN(sx,sy); real angle = a*180/G_PI; Point p = textobj->object.position; /* rotation is invariant to the handle position */ transform_point (&p, m); text_set_height (textobj->text, height); textobj->text_angle = angle; textobj->object.position = p; } textobj_update_data(textobj); return TRUE; }
void text_keypad_thumbscript_draw(GR_GC_ID gc) { char s[2]; GrLine(text_get_bufwid(), gc, 0, text_get_height()-16, text_get_width(), text_get_height()-16); switch (text_keypad_thumbscript_mode) { case 1: GrText(text_get_bufwid(), gc, text_get_width()/2, text_get_height()-4, "shift", -1, GR_TFASCII); break; case 3: case 2: case 4: case 5: case 6: GrText(text_get_bufwid(), gc, text_get_width()/2, text_get_height()-4, "mod", -1, GR_TFASCII); break; } if (text_keypad_thumbscript_last != 0) { s[0] = (text_keypad_thumbscript_last + '1'); s[1] = 0; GrText(text_get_bufwid(), gc, (text_get_width()*3)/4, text_get_height()-4, s, -1, GR_TFASCII); } }