--- deliantra/Deliantra-Client/Client.xs 2006/06/23 20:28:19 1.121 +++ deliantra/Deliantra-Client/Client.xs 2006/06/23 22:35:15 1.122 @@ -839,31 +839,37 @@ PangoAttrList *attrs = 0; const char *text = pango_layout_get_text (self->pl); const char *pos = text; - int arg = 2; + int arg = 4; while (arg < items && (pos = strstr (pos, OBJ_STR))) { - PangoRectangle rect; + PangoRectangle inkrect, rect; PangoAttribute *attr; + int x = SvIV (ST (arg - 3)); + int y = SvIV (ST (arg - 2)); int w = SvIV (ST (arg - 1)); - int h = SvIV (ST (arg)); + int h = SvIV (ST (arg )); - arg += 2; - - rect.x = 0; - rect.y = -h * PANGO_SCALE; - rect.width = w * PANGO_SCALE; + inkrect.x = 0; + inkrect.y = 0; + inkrect.width = 0; + inkrect.height = 0; + + rect.x = x * PANGO_SCALE; + rect.y = y * PANGO_SCALE; + rect.width = w * PANGO_SCALE; rect.height = h * PANGO_SCALE; if (!attrs) attrs = pango_layout_get_attributes (self->pl); - attr = pango_attr_shape_new (&rect, &rect); + attr = pango_attr_shape_new (&inkrect, &rect); attr->start_index = pos - text; attr->end_index = attr->start_index + sizeof (OBJ_STR) - 1; pango_attr_list_insert (attrs, attr); + arg += 4; pos += sizeof (OBJ_STR) - 1; } @@ -988,6 +994,18 @@ } int +descent (CFClient::Layout self) + CODE: +{ + PangoRectangle rect; + PangoLayoutLine *line = pango_layout_get_line (self->pl, 0); + pango_layout_line_get_pixel_extents (line, 0, &rect); + RETVAL = PANGO_DESCENT (rect); +} + OUTPUT: + RETVAL + +int xy_to_index (CFClient::Layout self, int x, int y) CODE: {