Ge texts only written to buffer, if double buffered, and some work on option menu

parent 6054598b
......@@ -1115,6 +1115,8 @@ void grow_CreateGrowMenu( grow_tCtx ctx, const char *name, glow_sMenuInfo *info,
fill_rect, border, fill_draw_type, text_size, text_drawtype,
text_color, disabled_text_color, text_font, (GlowArrayElem *)parent);
ctx->insert( r1);
ctx->pop( r1);
r1->draw();
*menu = (grow_tObject) r1;
}
......
......@@ -831,6 +831,10 @@ class GrowCtx : public GlowCtx {
void measure_window( double *ll_x, double *ll_y,
double *ur_x, double *ur_y);
void pop( GlowArrayElem *element) { a.pop( element);}
char name[40]; //!< Name of the context.
grow_eMode edit_mode; //!< Current edit mode.
int conpoint_num_cnt; //!< Counter to get next number for when creating conpoints in a subgraph.
......
......@@ -46,7 +46,6 @@ GrowMenu::GrowMenu( GrowCtx *glow_ctx, const char *name, glow_sMenuInfo *menu_in
{
if ( !nodraw)
draw( &ctx->mw, (GlowTransform *)NULL, highlight, hot, NULL, NULL);
}
GrowMenu::~GrowMenu()
......@@ -145,7 +144,7 @@ void GrowMenu::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
}
int idx;
int text_idx = int( trf.vertical_scale(t) * w->zoom_factor_y / w->base_zoom_factor * (text_size +4) - 4);
double tsize = trf.vertical_scale(t) * w->zoom_factor_y / w->base_zoom_factor * (8+2*text_size);
double tsize = trf.vertical_scale(t) * w->zoom_factor_y / w->base_zoom_factor * (8+2*text_size);
text_idx = min( text_idx, DRAW_TYPE_SIZE-1);
text_idx = max( 0, text_idx);
......@@ -186,9 +185,10 @@ void GrowMenu::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, void
ur_x = ll_x + int(min_width * w->zoom_factor_x);
ur_y = ll_y + int(tot_z_height);
if ( ur_y > ctx->y_high * w->zoom_factor_y + w->subwindow_y) {
if ( ur_y > w->window_height + w->offset_y + w->subwindow_y) {
// Outside window border
ur_y = int(ctx->y_high * w->zoom_factor_y + w->subwindow_y);
trf.move( 0, double(ur_y - (w->window_height + w->offset_y + w->subwindow_y)) / w->zoom_factor_y);
ur_y = w->window_height + w->offset_y + w->subwindow_y;
ll_y = ur_y - int(tot_z_height);
ll.posit_z( ll.z_x, ll_y + w->offset_y + w->subwindow_y);
ur.posit_z( ur.z_x, ur_y + w->offset_y + w->subwindow_y); // Might not always be correct?
......
......@@ -90,6 +90,8 @@ void GlowTipText::draw()
strlen(tiptext), glow_eDrawType_TextHelvetica, glow_eDrawType_Line, text_size,
0, 0, glow_eFont_Helvetica,
ctx->mw.zoom_factor_y / ctx->mw.base_zoom_factor * (8+2*text_size));
if ( ctx->mw.double_buffer_on() && !ctx->mw.draw_buffer_only())
ctx->gdraw->copy_buffer( &ctx->mw, text_x, text_y, text_x + text_width, text_y + text_height);
}
void GlowTipText::remove_text( GlowArrayElem *e)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment