{
float x = 0, y = 0;
float zoom = !value ? get_auto_zoom() : value;
- mwindow->edl->session->cwindow_scrollbars = !value ? 0 : 1;
+ EDL *edl = mwindow->edl;
+ edl->session->cwindow_scrollbars = !value ? 0 : 1;
if( value ) {
- float cx = canvas->get_xscroll() + 0.5f*canvas->w_visible;
- float cy = canvas->get_yscroll() + 0.5f*canvas->h_visible;
- float output_x = cx, output_y = cy;
- canvas->output_to_canvas(mwindow->edl, 0, cx, cy);
- x = output_x - cx / zoom;
- y = output_y - cy / zoom;
+ float cx = 0.5f * canvas->w; x = cx;
+ float cy = 0.5f * canvas->h; y = cy;
+ canvas->canvas_to_output(edl, 0, x, y);
+ canvas->update_zoom(0, 0, zoom);
+ float zoom_x, zoom_y, conformed_w, conformed_h;
+ canvas->get_zooms(edl, 0, zoom_x, zoom_y, conformed_w, conformed_h);
+ x -= cx / zoom_x;
+ y -= cy / zoom_y;
+
}
canvas->update_zoom((int)(x+0.5), (int)(y+0.5), zoom);
void LabelEdit::handle_done_event(int result)
{
- awindow->gui->async_update_assets();
+ if( !result ) {
+ strcpy(label->textstr, label_edit_window->textbox->get_text());
+ awindow->gui->async_update_assets();
+ }
}
BC_Window *LabelEdit::new_gui()
int x = 10, y = 10;
int x1 = x;
- BC_TextBox *textbox;
BC_Title *title;
add_subwindow(title = new BC_Title(x1, y, _("Label Text:")));
int LabelEditComments::handle_event()
{
- strcpy(window->label->textstr, get_text());
return 1;
}
void create_objects();
-// Use this copy of the pointer in LabelEdit since multiple windows are possible
Label *label;
MWindow *mwindow;
LabelEdit *thread;
+ BC_TextBox *textbox;
};
class LabelEditTitle : public BC_TextBox
window->enable_opengl();
// Composite texture to screen and swap buffer
case VFrame::TEXTURE:
+ if( !flip_y ) {
+ int fh1 = command->frame->get_h()-1;
+ float in_y1 = fh1 - command->in_y1;
+ float in_y2 = fh1 - command->in_y2;
+ command->in_y1 = in_y2;
+ command->in_y2 = in_y1;
+ }
draw_output(command, flip_y);
break;
default:
// GL_REPEAT in this case causes the upper left corners of the masks
// to blur.
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Get the texture to alpha blend
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// Shift down and right so 0,0 is the top left corner
- glTranslatef(-w/2, h/2, 0.0);
+ glTranslatef(-(w-1)/2.f, (h-1)/2.f, 0.0);
glTranslatef(0.0, 0.0, -(far + near) / 2);
glDisable(GL_DEPTH_TEST);