changeset 14:8da1d92ac8f8

Don't create fonts faces for size <= 0, and update objects when their font size is set
author thib
date Sat, 09 Aug 2008 12:04:08 +0000
parents a05bf0823154
children 38226842bac8
files scn2k/scn2k_grp.cc window/widget.cc
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scn2k/scn2k_grp.cc
+++ b/scn2k/scn2k_grp.cc
@@ -235,6 +235,7 @@ int GrpObj::PosY() {
 }
 void GrpObj::SetUpdate(void) {
 	attr = Attribute (attr | UPDATE_PICTURE);
+	Update(); //FIXME
 }
 void GrpObj::SetPos(int index, int x,int y) {
 	if (index < 0 || index > 8) {
@@ -512,7 +513,7 @@ TextStream GrpObj::ParseMoji(const char* str, int def_r ,int def_g, int def_b, int def_size) { // 制御シーケンス付き文字列をparse
 	return ts;
 }
 void GrpObj::UpdateMoji(void) { // 文字の大きさ、色などを変更
-	if (print_moji.length() == 0) return;
+	if (print_moji.length() == 0 || print_size <= 2) return;
 	if (pic_parent == 0) return;
 	/* テキストの大きさを得る */
 	int r, g, b;
--- a/window/widget.cc
+++ b/window/widget.cc
@@ -63,6 +63,7 @@ void SetFont(const char* font) {
 #define AnmPtnAlpha WidAnmPtnAlpha
 
 XKFont::HorizLayout* DefaultLayout(int text_size) {
+    if(text_size <= 0) abort();//FIXME: Find why the hell text_size can be <= 0
 	if (size_to_layout.find(text_size) == size_to_layout.end()) {
 		size_to_layout[text_size] = new XKFont::HorizLayout(wdefault_font.c_str(), text_size);
 	}