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,
memset(customcolors, 0, sizeof(customcolors));
if (type == glow_eCtxType_Brow)
ctx = (GlowCtx*)new BrowCtx("Claes context", 20);
ctx = (GlowCtx*)new BrowCtx("Claes context");
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)
ctx = (GlowCtx*)new ColPalCtx("Claes context", 20);
ctx = (GlowCtx*)new ColPalCtx("Claes context");
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)
ctx = (GlowCtx*)new CurveCtx("Claes context", 20);
ctx = (GlowCtx*)new CurveCtx("Claes context");
else
ctx = new GlowCtx("Claes context", 20);
ctx = new GlowCtx("Claes context");
*glow_ctx = (void*)ctx;
ctx->gdraw = this;
......
......@@ -54,7 +54,7 @@ class DrawWindGtk : public DrawWind {
public:
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;
window_width = window_height = 0;
subwindow_x = subwindow_y = 0;
......
......@@ -259,17 +259,17 @@ GlowDrawQt::GlowDrawQt(QWidget* toplevel, void** glow_ctx,
memset(customcolors, 0, sizeof(customcolors));
if (type == glow_eCtxType_Brow) {
ctx = (GlowCtx*)new BrowCtx("Claes context", 20);
ctx = (GlowCtx*)new BrowCtx("Claes context");
} 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) {
ctx = (GlowCtx*)new ColPalCtx("Claes context", 20);
ctx = (GlowCtx*)new ColPalCtx("Claes context");
} 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) {
ctx = (GlowCtx*)new CurveCtx("Claes context", 20);
ctx = (GlowCtx*)new CurveCtx("Claes context");
} else {
ctx = new GlowCtx("Claes context", 20);
ctx = new GlowCtx("Claes context");
}
*glow_ctx = (void*)ctx;
......
......@@ -60,7 +60,7 @@ class DrawWindQt : public DrawWind {
public:
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;
window_width = window_height = 0;
subwindow_x = subwindow_y = 0;
......
......@@ -43,9 +43,8 @@
class BrowCtx : public GlowCtx {
public:
BrowCtx(const char* ctx_name, double zoom_fact = 100)
: GlowCtx(ctx_name, zoom_fact), indentation(0.8), frame_x_right(0),
annotation_space(0.3)
BrowCtx(const char* ctx_name) : GlowCtx(ctx_name), indentation(0.8),
frame_x_right(0), annotation_space(0.3)
{
ctx_type = glow_eCtxType_Brow;
}
......
......@@ -67,10 +67,8 @@ public:
//! Constructor.
/*!
\param ctx_name Name of the context.
\param zoom_fact Initial zoomfactor.
*/
ColPalCtx(const char* ctx_name, double zoom_fact = 100)
: GrowCtx(ctx_name, zoom_fact), columns(30),
ColPalCtx(const char* ctx_name) : GrowCtx(ctx_name), columns(30),
current_fill(glow_eDrawType_LineGray),
current_border(glow_eDrawType_Line), current_text(glow_eDrawType_Line),
entry_width(0.3), entry_height(1), display_entry_width(3),
......
......@@ -61,7 +61,7 @@ CtxComment::CtxComment()
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),
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),
......
......@@ -90,12 +90,10 @@ public:
//! Constructor
/*!
\param ctx_name Name of context.
\param zoom_fact Initial zoom factor.
\param offs_x Initial offset for x-coordinate.
\param offs_y Initial offset for y-coordinate.
*/
GlowCtx(const char* ctx_name, double zoom_fact = 100, int offs_x = 0,
int offs_y = 0);
GlowCtx(const char* ctx_name, int offs_x = 0, int offs_y = 0);
glow_eCtxType ctx_type; //!< Type of context
DrawWind* mw; //!< Main window data.
......
......@@ -41,8 +41,7 @@
class CurveCtx : public GrowCtx {
public:
CurveCtx(const char* ctx_name, double zoom_fact = 100)
: GrowCtx(ctx_name, zoom_fact), layout_adjusted(0)
CurveCtx(const char* ctx_name) : GrowCtx(ctx_name), layout_adjusted(0)
{
ctx_type = glow_eCtxType_Curve;
}
......
......@@ -79,19 +79,17 @@ public:
double rank;
};
GrowCtx::GrowCtx(const char* ctx_name, double zoom_fact)
: GlowCtx(ctx_name, zoom_fact), edit_mode(grow_eMode_Edit),
conpoint_num_cnt(0), objectname_cnt(0), polyline_not_first(0),
background_color(glow_eDrawType_LineErase), highlight_disabled(0),
dynamic(0), dynamicsize(0), arg_cnt(0), x0(0), y0(0), x1(0), y1(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), move_restriction(glow_eMoveRestriction_No),
restriction_max_limit(0), restriction_min_limit(0), restriction_object(0),
subgraph(0), modified(0), export_jbean(0), animation_count(1),
scantime(0.5), fast_scantime(0.5), animation_scantime(0.5),
stored_zoom_factor_x(0), stored_zoom_factor_y(0), java_width(0),
enable_bg_pixmap(0), background_tiled(0), scale_active(0),
GrowCtx::GrowCtx(const char* ctx_name) : GlowCtx(ctx_name),
edit_mode(grow_eMode_Edit), conpoint_num_cnt(0), objectname_cnt(0),
polyline_not_first(0), background_color(glow_eDrawType_LineErase),
highlight_disabled(0), dynamic(0), dynamicsize(0), arg_cnt(0), x0(0), y0(0),
x1(0), y1(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),
move_restriction(glow_eMoveRestriction_No), restriction_max_limit(0),
restriction_min_limit(0), restriction_object(0), subgraph(0), modified(0),
export_jbean(0), animation_count(1), scantime(0.5), fast_scantime(0.5),
animation_scantime(0.5), stored_zoom_factor_x(0), stored_zoom_factor_y(0),
java_width(0), enable_bg_pixmap(0), background_tiled(0), scale_active(0),
initial_position(glow_eDirection_Up), is_javaapplet(0),
is_javaapplication(0), cycle(glow_eCycle_Slow),
mb3_action(glow_eMB3Action_PopupMenu), scale_equal(0), translate_on(0),
......
......@@ -72,9 +72,8 @@ public:
//! Constructor
/*!
\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
/*! Delete all objects. */
......
......@@ -919,12 +919,15 @@ void GrowWindow::new_ctx()
strcat(fname, ".pwg");
dcli_translate_filename(fname, fname);
window_ctx
= new GrowCtx("WindowComponent", ctx->mw->zoom_factor_x * window_scale);
window_ctx = new GrowCtx("WindowComponent");
window_ctx->gdraw = ctx->gdraw;
window_ctx->is_subwindow = 1;
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->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_open_callback = ctx->userdata_open_callback;
window_ctx->userdata_copy_callback = ctx->userdata_copy_callback;
......
......@@ -71,11 +71,9 @@ public:
//! Constructor.
/*!
\param ctx_name Name of the context.
\param zoom_fact Initial zoomfactor.
*/
KeyboardCtx(const char* ctx_name, double zoom_fact = 100)
: GrowCtx(ctx_name, zoom_fact), type(default_type),
current_keymap(default_keymap)
KeyboardCtx(const char* ctx_name)
: GrowCtx(ctx_name), type(default_type), current_keymap(default_keymap)
{
ctx_type = glow_eCtxType_Keyboard;
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