Commit abff9ea4 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Glow: Fixed initial zoom factor.

parent 8dc32763
...@@ -581,17 +581,17 @@ GlowDrawGtk::GlowDrawGtk(GtkWidget* toplevel, void** glow_ctx, ...@@ -581,17 +581,17 @@ GlowDrawGtk::GlowDrawGtk(GtkWidget* toplevel, void** glow_ctx,
memset(customcolors, 0, sizeof(customcolors)); memset(customcolors, 0, sizeof(customcolors));
if (type == glow_eCtxType_Brow) if (type == glow_eCtxType_Brow)
ctx = (GlowCtx*)new BrowCtx("Claes context", 20); ctx = (GlowCtx*)new BrowCtx("Claes context");
else if (type == glow_eCtxType_Grow) else if (type == glow_eCtxType_Grow)
ctx = (GlowCtx*)new GrowCtx("Claes context", 20); ctx = (GlowCtx*)new GrowCtx("Claes context");
else if (type == glow_eCtxType_ColPal) else if (type == glow_eCtxType_ColPal)
ctx = (GlowCtx*)new ColPalCtx("Claes context", 20); ctx = (GlowCtx*)new ColPalCtx("Claes context");
else if (type == glow_eCtxType_Keyboard) else if (type == glow_eCtxType_Keyboard)
ctx = (GlowCtx*)new KeyboardCtx("Claes context", 20); ctx = (GlowCtx*)new KeyboardCtx("Claes context");
else if (type == glow_eCtxType_Curve) else if (type == glow_eCtxType_Curve)
ctx = (GlowCtx*)new CurveCtx("Claes context", 20); ctx = (GlowCtx*)new CurveCtx("Claes context");
else else
ctx = new GlowCtx("Claes context", 20); ctx = new GlowCtx("Claes context");
*glow_ctx = (void*)ctx; *glow_ctx = (void*)ctx;
ctx->gdraw = this; ctx->gdraw = this;
......
...@@ -54,7 +54,7 @@ class DrawWindGtk : public DrawWind { ...@@ -54,7 +54,7 @@ class DrawWindGtk : public DrawWind {
public: public:
DrawWindGtk() DrawWindGtk()
{ {
zoom_factor_x = zoom_factor_y = base_zoom_factor = 100; zoom_factor_x = zoom_factor_y = base_zoom_factor = 20;
offset_x = offset_y = 0; offset_x = offset_y = 0;
window_width = window_height = 0; window_width = window_height = 0;
subwindow_x = subwindow_y = 0; subwindow_x = subwindow_y = 0;
......
...@@ -259,17 +259,17 @@ GlowDrawQt::GlowDrawQt(QWidget* toplevel, void** glow_ctx, ...@@ -259,17 +259,17 @@ GlowDrawQt::GlowDrawQt(QWidget* toplevel, void** glow_ctx,
memset(customcolors, 0, sizeof(customcolors)); memset(customcolors, 0, sizeof(customcolors));
if (type == glow_eCtxType_Brow) { if (type == glow_eCtxType_Brow) {
ctx = (GlowCtx*)new BrowCtx("Claes context", 20); ctx = (GlowCtx*)new BrowCtx("Claes context");
} else if (type == glow_eCtxType_Grow) { } else if (type == glow_eCtxType_Grow) {
ctx = (GlowCtx*)new GrowCtx("Claes context", 20); ctx = (GlowCtx*)new GrowCtx("Claes context");
} else if (type == glow_eCtxType_ColPal) { } else if (type == glow_eCtxType_ColPal) {
ctx = (GlowCtx*)new ColPalCtx("Claes context", 20); ctx = (GlowCtx*)new ColPalCtx("Claes context");
} else if (type == glow_eCtxType_Keyboard) { } else if (type == glow_eCtxType_Keyboard) {
ctx = (GlowCtx*)new KeyboardCtx("Claes context", 20); ctx = (GlowCtx*)new KeyboardCtx("Claes context");
} else if (type == glow_eCtxType_Curve) { } else if (type == glow_eCtxType_Curve) {
ctx = (GlowCtx*)new CurveCtx("Claes context", 20); ctx = (GlowCtx*)new CurveCtx("Claes context");
} else { } else {
ctx = new GlowCtx("Claes context", 20); ctx = new GlowCtx("Claes context");
} }
*glow_ctx = (void*)ctx; *glow_ctx = (void*)ctx;
......
...@@ -60,7 +60,7 @@ class DrawWindQt : public DrawWind { ...@@ -60,7 +60,7 @@ class DrawWindQt : public DrawWind {
public: public:
DrawWindQt() DrawWindQt()
{ {
zoom_factor_x = zoom_factor_y = base_zoom_factor = 100; zoom_factor_x = zoom_factor_y = base_zoom_factor = 20;
offset_x = offset_y = 0; offset_x = offset_y = 0;
window_width = window_height = 0; window_width = window_height = 0;
subwindow_x = subwindow_y = 0; subwindow_x = subwindow_y = 0;
......
...@@ -43,9 +43,8 @@ ...@@ -43,9 +43,8 @@
class BrowCtx : public GlowCtx { class BrowCtx : public GlowCtx {
public: public:
BrowCtx(const char* ctx_name, double zoom_fact = 100) BrowCtx(const char* ctx_name) : GlowCtx(ctx_name), indentation(0.8),
: GlowCtx(ctx_name, zoom_fact), indentation(0.8), frame_x_right(0), frame_x_right(0), annotation_space(0.3)
annotation_space(0.3)
{ {
ctx_type = glow_eCtxType_Brow; ctx_type = glow_eCtxType_Brow;
} }
......
...@@ -67,14 +67,12 @@ public: ...@@ -67,14 +67,12 @@ public:
//! Constructor. //! Constructor.
/*! /*!
\param ctx_name Name of the context. \param ctx_name Name of the context.
\param zoom_fact Initial zoomfactor.
*/ */
ColPalCtx(const char* ctx_name, double zoom_fact = 100) ColPalCtx(const char* ctx_name) : GrowCtx(ctx_name), columns(30),
: GrowCtx(ctx_name, zoom_fact), columns(30), current_fill(glow_eDrawType_LineGray),
current_fill(glow_eDrawType_LineGray), current_border(glow_eDrawType_Line), current_text(glow_eDrawType_Line),
current_border(glow_eDrawType_Line), current_text(glow_eDrawType_Line), entry_width(0.3), entry_height(1), display_entry_width(3),
entry_width(0.3), entry_height(1), display_entry_width(3), active(colpal_eActive_FillColor)
active(colpal_eActive_FillColor)
{ {
ctx_type = glow_eCtxType_ColPal; ctx_type = glow_eCtxType_ColPal;
grid_on = 0; grid_on = 0;
......
...@@ -61,7 +61,7 @@ CtxComment::CtxComment() ...@@ -61,7 +61,7 @@ CtxComment::CtxComment()
memset(text, 0, sizeof(text)); memset(text, 0, sizeof(text));
} }
GlowCtx::GlowCtx(const char* ctx_name, double zoom_fact, int offs_x, int offs_y) GlowCtx::GlowCtx(const char* ctx_name, int offs_x, int offs_y)
: ctx_type(glow_eCtxType_Glow), print_zoom_factor(100), x_right(0), : ctx_type(glow_eCtxType_Glow), print_zoom_factor(100), x_right(0),
x_left(0), y_high(0), y_low(0), nav_rect_ll_x(0), nav_rect_ll_y(0), x_left(0), y_high(0), y_low(0), nav_rect_ll_x(0), nav_rect_ll_y(0),
nav_rect_ur_x(0), nav_rect_ur_y(0), gdraw(0), node_movement_active(0), nav_rect_ur_x(0), nav_rect_ur_y(0), gdraw(0), node_movement_active(0),
......
...@@ -90,12 +90,10 @@ public: ...@@ -90,12 +90,10 @@ public:
//! Constructor //! Constructor
/*! /*!
\param ctx_name Name of context. \param ctx_name Name of context.
\param zoom_fact Initial zoom factor.
\param offs_x Initial offset for x-coordinate. \param offs_x Initial offset for x-coordinate.
\param offs_y Initial offset for y-coordinate. \param offs_y Initial offset for y-coordinate.
*/ */
GlowCtx(const char* ctx_name, double zoom_fact = 100, int offs_x = 0, GlowCtx(const char* ctx_name, int offs_x = 0, int offs_y = 0);
int offs_y = 0);
glow_eCtxType ctx_type; //!< Type of context glow_eCtxType ctx_type; //!< Type of context
DrawWind* mw; //!< Main window data. DrawWind* mw; //!< Main window data.
......
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
class CurveCtx : public GrowCtx { class CurveCtx : public GrowCtx {
public: public:
CurveCtx(const char* ctx_name, double zoom_fact = 100) CurveCtx(const char* ctx_name) : GrowCtx(ctx_name), layout_adjusted(0)
: GrowCtx(ctx_name, zoom_fact), layout_adjusted(0)
{ {
ctx_type = glow_eCtxType_Curve; ctx_type = glow_eCtxType_Curve;
} }
......
...@@ -79,27 +79,25 @@ public: ...@@ -79,27 +79,25 @@ public:
double rank; double rank;
}; };
GrowCtx::GrowCtx(const char* ctx_name, double zoom_fact) GrowCtx::GrowCtx(const char* ctx_name) : GlowCtx(ctx_name),
: GlowCtx(ctx_name, zoom_fact), edit_mode(grow_eMode_Edit), edit_mode(grow_eMode_Edit), conpoint_num_cnt(0), objectname_cnt(0),
conpoint_num_cnt(0), objectname_cnt(0), polyline_not_first(0), polyline_not_first(0), background_color(glow_eDrawType_LineErase),
background_color(glow_eDrawType_LineErase), highlight_disabled(0), highlight_disabled(0), dynamic(0), dynamicsize(0), arg_cnt(0), x0(0), y0(0),
dynamic(0), dynamicsize(0), arg_cnt(0), x0(0), y0(0), x1(0), y1(0), x1(0), y1(0), path_cnt(0), dyn_type1(0), dyn_type2(0), dyn_action_type1(0),
path_cnt(0), dyn_type1(0), dyn_type2(0), dyn_action_type1(0), dyn_action_type2(0), no_con_obstacle(0), slider(0), slider_cursor_offset(0),
dyn_action_type2(0), no_con_obstacle(0), slider(0), move_restriction(glow_eMoveRestriction_No), restriction_max_limit(0),
slider_cursor_offset(0), move_restriction(glow_eMoveRestriction_No), restriction_min_limit(0), restriction_object(0), subgraph(0), modified(0),
restriction_max_limit(0), restriction_min_limit(0), restriction_object(0), export_jbean(0), animation_count(1), scantime(0.5), fast_scantime(0.5),
subgraph(0), modified(0), export_jbean(0), animation_count(1), animation_scantime(0.5), stored_zoom_factor_x(0), stored_zoom_factor_y(0),
scantime(0.5), fast_scantime(0.5), animation_scantime(0.5), java_width(0), enable_bg_pixmap(0), background_tiled(0), scale_active(0),
stored_zoom_factor_x(0), stored_zoom_factor_y(0), java_width(0), initial_position(glow_eDirection_Up), is_javaapplet(0),
enable_bg_pixmap(0), background_tiled(0), scale_active(0), is_javaapplication(0), cycle(glow_eCycle_Slow),
initial_position(glow_eDirection_Up), is_javaapplet(0), mb3_action(glow_eMB3Action_PopupMenu), scale_equal(0), translate_on(0),
is_javaapplication(0), cycle(glow_eCycle_Slow), input_focus_mark(glow_eInputFocusMark_Relief), background_disabled(0),
mb3_action(glow_eMB3Action_PopupMenu), scale_equal(0), translate_on(0), redraw_callback(0), redraw_data(0), has_subwindows(-1), is_subwindow(0),
input_focus_mark(glow_eInputFocusMark_Relief), background_disabled(0), bitmap_fonts(0), environment(glow_eEnv_Runtime),
redraw_callback(0), redraw_data(0), has_subwindows(-1), is_subwindow(0), text_coding(glow_eTextCoding_ISO8859_1), recursive_trace(0),
bitmap_fonts(0), environment(glow_eEnv_Runtime), edit_set_mode(glow_eEditSetMode_None)
text_coding(glow_eTextCoding_ISO8859_1), recursive_trace(0),
edit_set_mode(glow_eEditSetMode_None)
{ {
ctx_type = glow_eCtxType_Grow; ctx_type = glow_eCtxType_Grow;
strcpy(name, ""); strcpy(name, "");
......
...@@ -72,9 +72,8 @@ public: ...@@ -72,9 +72,8 @@ public:
//! Constructor //! Constructor
/*! /*!
\param ctx_name Name of context. \param ctx_name Name of context.
\param zoom_fact Initial zoom factor.
*/ */
GrowCtx(const char* ctx_name, double zoom_fact = 100); GrowCtx(const char* ctx_name);
//! Destructor //! Destructor
/*! Delete all objects. */ /*! Delete all objects. */
......
...@@ -919,12 +919,15 @@ void GrowWindow::new_ctx() ...@@ -919,12 +919,15 @@ void GrowWindow::new_ctx()
strcat(fname, ".pwg"); strcat(fname, ".pwg");
dcli_translate_filename(fname, fname); dcli_translate_filename(fname, fname);
window_ctx window_ctx = new GrowCtx("WindowComponent");
= new GrowCtx("WindowComponent", ctx->mw->zoom_factor_x * window_scale);
window_ctx->gdraw = ctx->gdraw; window_ctx->gdraw = ctx->gdraw;
window_ctx->is_subwindow = 1; window_ctx->is_subwindow = 1;
window_ctx->mw = ctx->mw->copy(); window_ctx->mw = ctx->mw->copy();
window_ctx->mw->zoom_factor_x = window_ctx->mw->zoom_factor_y =
window_ctx->mw->base_zoom_factor = ctx->mw->zoom_factor_x * window_scale;
window_ctx->navw = ctx->navw->copy(); window_ctx->navw = ctx->navw->copy();
window_ctx->navw->zoom_factor_x = window_ctx->navw->zoom_factor_y =
window_ctx->navw->base_zoom_factor = ctx->mw->zoom_factor_x * window_scale;
window_ctx->userdata_save_callback = ctx->userdata_save_callback; window_ctx->userdata_save_callback = ctx->userdata_save_callback;
window_ctx->userdata_open_callback = ctx->userdata_open_callback; window_ctx->userdata_open_callback = ctx->userdata_open_callback;
window_ctx->userdata_copy_callback = ctx->userdata_copy_callback; window_ctx->userdata_copy_callback = ctx->userdata_copy_callback;
......
...@@ -71,11 +71,9 @@ public: ...@@ -71,11 +71,9 @@ public:
//! Constructor. //! Constructor.
/*! /*!
\param ctx_name Name of the context. \param ctx_name Name of the context.
\param zoom_fact Initial zoomfactor.
*/ */
KeyboardCtx(const char* ctx_name, double zoom_fact = 100) KeyboardCtx(const char* ctx_name)
: GrowCtx(ctx_name, zoom_fact), type(default_type), : GrowCtx(ctx_name), type(default_type), current_keymap(default_keymap)
current_keymap(default_keymap)
{ {
ctx_type = glow_eCtxType_Keyboard; ctx_type = glow_eCtxType_Keyboard;
grid_on = 0; grid_on = 0;
......
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