X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=ba93e19980a70c0ca995f9e136e2c644670d62a4;hb=72a88d4704507f72e05b380d9604d9eb3e7d5a89;hp=0cf4c8fe31d4221e658143c46bd0b8990d931a16;hpb=1d4f5d708de0d8ec19300b417354a3374d00ed47;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 0cf4c8fe..ba93e199 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -411,7 +411,7 @@ void TitleWindow::create_objects() png_popup = new TitlePngPopup(client, this); show_window(1); - update(); + update_gui(); } int TitleWindow::resize_event(int w, int h) @@ -490,8 +490,9 @@ void TitleWindow::send_configure_change() void TitleWindow::previous_font() { int current_font = font->get_number(); - current_font--; - if( current_font < 0 ) current_font = fonts.total - 1; + if( !fonts.total ) current_font = -1; + else if( --current_font < 0 ) current_font = fonts.total - 1; + font->set_number(current_font); if( current_font < 0 || current_font >= fonts.total ) return; @@ -508,8 +509,9 @@ void TitleWindow::previous_font() void TitleWindow::next_font() { int current_font = font->get_number(); - current_font++; - if( current_font >= fonts.total ) current_font = 0; + if( !fonts.total ) current_font = -1; + else if( ++current_font >= fonts.total ) current_font = 0; + font->set_number(current_font); if( current_font < 0 || current_font >= fonts.total ) return; @@ -562,7 +564,7 @@ void TitleWindow::update_stats() text_chars->update(client->config.wlen); } -void TitleWindow::update() +void TitleWindow::update_gui() { title_x->update((int64_t)client->config.title_x); title_y->update((int64_t)client->config.title_y); @@ -940,6 +942,7 @@ void TitleWindow::check_style(const char *font_name, int update) int style = stroker && atof(stroker->get_text()) ? BC_FONT_OUTLINE : 0; if( bold->get_value() ) style |= BC_FONT_BOLD; if( italic->get_value() ) style |= BC_FONT_ITALIC; + if( alias->get_value() ) style |= FONT_ALIAS; client->config.style = style; } } @@ -1232,7 +1235,8 @@ TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y) Track *TitleDrag::get_drag_track() { - return client->server->plugin->track; + return !client->server->plugin ? 0 : + client->server->plugin->track; } int64_t TitleDrag::get_drag_position() {