remove redundant buffer character positioning code & remove attr keyword argument from property definitions.
This commit is contained in:
@@ -22,7 +22,7 @@ from bpy.props import *
|
||||
|
||||
|
||||
class PoseTemplate(bpy.types.IDPropertyGroup):
|
||||
name = StringProperty(attr="name", name="Name of the slave", description="", maxlen=64, default="")
|
||||
name = StringProperty(name="Name of the slave", description="", maxlen=64, default="")
|
||||
active_template_index = IntProperty(name="Index of the active slave", description="", default=-1, min=-1, max=65535)
|
||||
use_generate_deform_rig = BoolProperty(name="Create Deform Rig", description="Create a copy of the metarig, constrainted by the generated rig", default=False)
|
||||
|
||||
|
||||
@@ -691,7 +691,7 @@ class WM_OT_keymap_restore(bpy.types.Operator):
|
||||
bl_idname = "wm.keymap_restore"
|
||||
bl_label = "Restore Key Map(s)"
|
||||
|
||||
all = BoolProperty(attr="all", name="All Keymaps", description="Restore all keymaps to default")
|
||||
all = BoolProperty(name="All Keymaps", description="Restore all keymaps to default")
|
||||
|
||||
def execute(self, context):
|
||||
wm = context.window_manager
|
||||
@@ -711,7 +711,7 @@ class WM_OT_keyitem_restore(bpy.types.Operator):
|
||||
bl_idname = "wm.keyitem_restore"
|
||||
bl_label = "Restore Key Map Item"
|
||||
|
||||
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
||||
item_id = IntProperty(name="Item Identifier", description="Identifier of the item to remove")
|
||||
|
||||
def execute(self, context):
|
||||
wm = context.window_manager
|
||||
@@ -752,7 +752,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator):
|
||||
bl_idname = "wm.keyitem_remove"
|
||||
bl_label = "Remove Key Map Item"
|
||||
|
||||
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
||||
item_id = IntProperty(name="Item Identifier", description="Identifier of the item to remove")
|
||||
|
||||
def execute(self, context):
|
||||
wm = context.window_manager
|
||||
|
||||
@@ -155,7 +155,7 @@ void blf_font_buffer(FontBLF *font, char *str)
|
||||
FT_Vector delta;
|
||||
FT_UInt glyph_index;
|
||||
float a, *fbuf;
|
||||
int pen_x, y, x, yb, diff;
|
||||
int pen_x, y, x, yb;
|
||||
int i, has_kerning, st, chx, chy;
|
||||
|
||||
if (!font->glyph_cache || (!font->b_fbuf && !font->b_cbuf))
|
||||
@@ -186,8 +186,6 @@ void blf_font_buffer(FontBLF *font, char *str)
|
||||
if (!g)
|
||||
continue;
|
||||
|
||||
pen_y= (int)font->pos[1];
|
||||
|
||||
if (has_kerning && g_prev) {
|
||||
delta.x= 0;
|
||||
delta.y= 0;
|
||||
@@ -202,16 +200,9 @@ void blf_font_buffer(FontBLF *font, char *str)
|
||||
}
|
||||
|
||||
chx= pen_x + ((int)g->pos_x);
|
||||
diff= g->height - ((int)g->pos_y);
|
||||
|
||||
if (g->pitch < 0) {
|
||||
pen_y += diff;
|
||||
chy= pen_y - ((int)g->pos_y);
|
||||
}
|
||||
else {
|
||||
pen_y -= diff;
|
||||
chy= pen_y + ((int)g->pos_y);
|
||||
}
|
||||
pen_y= (int)font->pos[1] - (g->height - ((int)g->pos_y));
|
||||
chy= pen_y - ((int)g->pos_y);
|
||||
|
||||
if ((chx + g->width) >= 0 && chx < font->bw && (pen_y + g->height) >= 0 && pen_y < font->bh) {
|
||||
/* dont draw beyond the buffer bounds */
|
||||
@@ -279,19 +270,6 @@ void blf_font_buffer(FontBLF *font, char *str)
|
||||
}
|
||||
}
|
||||
|
||||
if (diff > 0) {
|
||||
if (g->pitch < 0)
|
||||
pen_x -= diff;
|
||||
else
|
||||
pen_y += diff;
|
||||
}
|
||||
else if (diff < 0) {
|
||||
if (g->pitch < 0)
|
||||
pen_x += diff;
|
||||
else
|
||||
pen_y -= diff;
|
||||
}
|
||||
|
||||
pen_x += g->advance;
|
||||
g_prev= g;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user