X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=de6d10cbda4d64c5e6e558ec3c5f99e9d7bc95b6;hb=48a6854a1ca58aa291ffc6fe3a48807492dfbef7;hp=4c8791582d02705f47420c2d82bfa2dcb82e4bcd;hpb=9e3d90a964c0fbe97c0b58235336a47111932d5d;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 4c879158..de6d10cb 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -40,6 +40,7 @@ #include "pluginserver.h" #include "theme.h" #include "track.h" +#include "tracks.h" #include "titlerwindow.h" #include "bcfontentry.h" @@ -138,6 +139,8 @@ TitleWindow::~TitleWindow() delete timecode_format; delete title_x; delete title_y; + delete title_w; + delete title_h; } void TitleWindow::create_objects() @@ -261,10 +264,8 @@ void TitleWindow::create_objects() add_tool(drag = new TitleDrag(client, this, x, y + yS(80))); drag->create_objects(); if( drag->get_w() > w1 ) w1 = drag->get_w(); - if( client->config.drag ) { - if( drag->drag_activate() ) - eprintf("drag enabled, but compositor already grabbed\n"); - } + if( client->config.drag && drag->drag_activate() ) + eprintf("drag enabled, but compositor already grabbed\n"); add_tool(alias = new TitleAlias(client, this, x, y+yS(110))); if( alias->get_w() > w1 ) w1 = drag->get_w(); @@ -571,6 +572,10 @@ void TitleWindow::update_gui() title_y->update((int64_t)client->config.title_y); title_w->update((int64_t)client->config.title_w); title_h->update((int64_t)client->config.title_h); + drag->drag_x = client->config.title_x; + drag->drag_y = client->config.title_y; + drag->drag_w = client->config.title_w; + drag->drag_h = client->config.title_h; italic->update(client->config.style & BC_FONT_ITALIC); bold->update(client->config.style & BC_FONT_BOLD); alias->update(client->config.style & FONT_ALIAS); @@ -1237,8 +1242,10 @@ TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y) Track *TitleDrag::get_drag_track() { - return !client->server->plugin ? 0 : - client->server->plugin->track; + PluginServer *server = client->server; + int plugin_id = server->plugin_id; + Plugin *plugin = server->edl->tracks->plugin_exists(plugin_id); + return !plugin ? 0 : plugin->track; } int64_t TitleDrag::get_drag_position() { @@ -1546,7 +1553,7 @@ void TitlePngPopup::handle_done_event(int result) if( result ) return; BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui(); const char *path = gui->get_submitted_path(); - char txt[BCSTRLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path); + char txt[BCTEXTLEN]; sprintf(txt, "<%s %s>", _(KW_PNG), path); window->lock_window("TitlePngPopup::handle_done_event"); window->insert_ibeam(txt); window->unlock_window();