X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=mail.ud03.udmedia.de; h= message-id:date:from:mime-version:to:subject:content-type; s= beta; bh=0j5yWx31gw+jbk5x8B6r3HId3kXFscXSzf3Id5tIIkk=; b=vFUsQkd Bqpfao9YuLZdPKjuGKNHq8S8O8fh1H+j4N3zX52XD3hRm6iEj9HfJG9nPmxwCO7/ fVZhN735l2xP11xNOhMhdTVDmJDV/RF4xiLqKVVrg5YQKb8Z7jVldyWUojjjhhPn oUaOqiw14LUajZVlmwLKkrnMUYI5ofGVVq94= Message-ID: <50315696.3030400@jump-ing.de> Date: Sun, 19 Aug 2012 23:11:50 +0200 From: Markus Hitter User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: gEDA User Mailing List Subject: [geda-user] First steps on dynamic board size Content-Type: multipart/mixed; boundary="------------090108040108020200070700" Reply-To: geda-user AT delorie DOT com This is a multi-part message in MIME format. --------------090108040108020200070700 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit A first step towards dynamic board size is done. As this goes beyond my allowed committer's scope, I've put this into a new branch for review, "dynamic_extent". As I can't find a public git repo viewer, I've also attached the patches to this email. The strategy choosen is to introduce ExtentMinX, ExtentMaxX, ExtentMinY and ExtentMaxY into the global PCBType and to fill these with the extent of the drawn lines on the outline layer (BTW., as I write this: the first char of the names should be lower case, right?). Now exporters can use this board extent easily to adjust their output. One open question is how to update these variables effectively. Every time a line on the outline layer is moved or drawn? For now it's only on file load, which is not enough. The second commit/patch marks all the places where the new variables might make a code change advisable. Not only in the exporters; I think the GUIs can be changed for the better, too. Like drawing a background image to the extent of the board instead on the entire drawing area. Like limiting autorouting to the outline limits. Eventually, the drawing area might be only limited by the size of the internally used integers and setting a board size in preferences becomes obsolete. Let me know what you think, wether this is the right direction. Markus -- - - - - - - - - - - - - - - - - - - - Dipl. Ing. (FH) Markus Hitter http://www.jump-ing.de/ --------------090108040108020200070700 Content-Type: text/x-patch; name="0001-Introduce-dynamic-board-size.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Introduce-dynamic-board-size.patch" From f4cc6d3705383fa1f5e231b63102bb19c954bc9d Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 19 Aug 2012 21:59:13 +0200 Subject: [PATCH 1/2] Introduce dynamic board size. The goal is to eventually define the board's extent by the outline layer, only. That way, all the exporters can export properly sized layouts. Undoubtly, this can also influence the GUIs. For example, "zoom to fit" becomes a slightly different meaning and drawing outside the board's extent becomes possible. Autorouting and similars can be limited to the actual board size. Resizing a board to the lower left no longer requires the error-prone moving of all the stuff and keeps file diffs small. --- src/change.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/change.h | 1 + src/global.h | 9 ++++++--- 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/change.c b/src/change.c index 59bf4a4..b3913c8 100644 --- a/src/change.c +++ b/src/change.c @@ -2344,10 +2344,72 @@ ChangePCBSize (Coord Width, Coord Height) Y))); else SetCrosshairRange (0, 0, Width, Height); + + UpdateOutputExtents(); hid_action ("PCBChanged"); } /* --------------------------------------------------------------------------- + * finds the maximum size of a layout + * according to the outline layer, + * if present. + */ +void +UpdateOutputExtents (void) +{ + Coord minX, minY, maxX, maxY; + + minX = minY = COORD_MAX; + maxX = maxY = -COORD_MAX - 1; + + LAYER_LOOP (PCB->Data, MAX_LAYER); + { + if (strcmp (layer->Name, "outline") == 0) + { + LINE_LOOP (layer); + { + if (line->Point1.X < minX) + minX = line->Point1.X; + if (line->Point1.Y < minY) + minY = line->Point1.Y; + if (line->Point2.X < minX) + minX = line->Point2.X; + if (line->Point2.Y < minY) + minY = line->Point2.Y; + if (line->Point1.X > maxX) + maxX = line->Point1.X; + if (line->Point1.Y > maxY) + maxY = line->Point1.Y; + if (line->Point2.X > maxX) + maxX = line->Point2.X; + if (line->Point2.Y > maxY) + maxY = line->Point2.Y; + } + END_LOOP; + } + } + END_LOOP; + + if (minX == COORD_MAX || minY == COORD_MAX || + maxX == -COORD_MAX - 1 || maxY == -COORD_MAX - 1 || + maxX - minX == 0 || maxY - minY == 0) + { + // no or insufficient outline layer + PCB->ExtentMinX = 0; + PCB->ExtentMinY = 0; + PCB->ExtentMaxX = PCB->MaxWidth; + PCB->ExtentMaxY = PCB->MaxHeight; + } + else + { + PCB->ExtentMinX = minX; + PCB->ExtentMinY = minY; + PCB->ExtentMaxX = maxX; + PCB->ExtentMaxY = maxY; + } +} + +/* --------------------------------------------------------------------------- * changes the mask size of a pad * returns TRUE if changed */ diff --git a/src/change.h b/src/change.h index f42842a..cc7ef01 100644 --- a/src/change.h +++ b/src/change.h @@ -106,6 +106,7 @@ bool ClrObjectOctagon (int, void *, void *, void *); void *ChangeObjectName (int, void *, void *, void *, char *); void *QueryInputAndChangeObjectName (int, void *, void *, void *); void ChangePCBSize (Coord, Coord); +void UpdateOutputExtents (void); /* Change the specified text on an element, either on the board (give PCB, PCB->Data) or in a buffer (give NULL, Buffer->Data). The old diff --git a/src/global.h b/src/global.h index 7b28396..ff1e73f 100644 --- a/src/global.h +++ b/src/global.h @@ -510,9 +510,12 @@ typedef struct PCBType CursorY, Clipping; Coord Bloat, /* drc sizes saved with layout */ Shrink, minWid, minSlk, minDrill, minRing; - Coord GridOffsetX, /* as saved with layout */ - GridOffsetY, MaxWidth, /* allowed size */ - MaxHeight; + Coord GridOffsetX, GridOffsetY; /* as saved with layout */ + /* TODO: set this always to MAX_COORD, no saving needed. + Kept for compatibility for now. */ + Coord MaxWidth, MaxHeight; /* allowed size */ + Coord ExtentMinX, ExtentMinY, /* extents, defined by the outline layer */ + ExtentMaxX, ExtentMaxY; Coord Grid; /* used grid with offsets */ double Zoom, /* zoom factor */ -- 1.7.9.5 --------------090108040108020200070700 Content-Type: text/x-patch; name="0002-Mark-the-possible-influence-of-the-new-dynamic-outli.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Mark-the-possible-influence-of-the-new-dynamic-outli.pa"; filename*1="tch" From 17556e4c1bbf0f526dae682ddb20bdb4105ccc78 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 19 Aug 2012 22:06:50 +0200 Subject: [PATCH 2/2] Mark the possible influence of the new dynamic outline. This puts a TODO comment everywhere where a code change to adjust for the new dynamic outline strategy might be advised. Now one can review all the areas and change the code or just remove the comment (in case there's no code change needed). --- src/action.c | 8 ++++++++ src/autoplace.c | 8 ++++++++ src/autoroute.c | 3 +++ src/crosshair.c | 2 ++ src/draw.c | 4 ++++ src/file.c | 5 +++++ src/fontmode.c | 4 ++++ src/hid/batch/batch.c | 2 ++ src/hid/gcode/gcode.c | 12 ++++++++++++ src/hid/gerber/gerber.c | 6 ++++++ src/hid/gtk/gtkhid-gdk.c | 14 ++++++++++++++ src/hid/gtk/gtkhid-gl.c | 24 ++++++++++++++++++++++++ src/hid/gtk/gtkhid-main.c | 4 ++++ src/hid/gtk/gui-config.c | 4 ++++ src/hid/gtk/gui-output-events.c | 4 ++++ src/hid/gtk/gui.h | 2 ++ src/hid/lesstif/dialogs.c | 6 ++++++ src/hid/lesstif/main.c | 8 ++++++++ src/hid/nelma/nelma.c | 4 ++++ src/hid/png/png.c | 8 ++++++++ src/hid/ps/eps.c | 2 ++ src/hid/ps/ps.c | 12 ++++++++++++ src/misc.c | 2 ++ src/print.c | 4 ++++ src/set.c | 4 ++++ src/toporouter.c | 4 ++++ 26 files changed, 160 insertions(+) diff --git a/src/action.c b/src/action.c index b29d40b..4a5b9f7 100644 --- a/src/action.c +++ b/src/action.c @@ -2425,6 +2425,8 @@ ActionDisperseElements (int argc, char **argv, Coord x, Coord y) dx += PCB->Grid; /* Figure out if this row has room. If not, start a new row */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (GAP + element->BoundingBox.X2 + dx > PCB->MaxWidth) { miny = maxy + GAP; @@ -5923,6 +5925,8 @@ ActionNew (int argc, char **argv, Coord x, Coord y) PCB->Name = name; ResetStackAndVisibility (); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ SetCrosshairRange (0, 0, PCB->MaxWidth, PCB->MaxHeight); CenterDisplay (PCB->MaxWidth / 2, PCB->MaxHeight / 2); Redraw (); @@ -7069,6 +7073,8 @@ ActionElementList (int argc, char **argv, Coord x, Coord y) return 1; } + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ nx = PCB->MaxWidth / 2; ny = PCB->MaxHeight / 2; d = MIN (PCB->MaxWidth, PCB->MaxHeight) / 10; @@ -7083,6 +7089,8 @@ ActionElementList (int argc, char **argv, Coord x, Coord y) ny += rand () % (d*2) - d; } + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (nx < 0) nx = 0; if (nx >= PCB->MaxWidth) diff --git a/src/autoplace.c b/src/autoplace.c index 21ab5f2..adb77ab 100644 --- a/src/autoplace.c +++ b/src/autoplace.c @@ -298,6 +298,8 @@ r_find_neighbor (rtree_t * rtree, const BoxType * box, ni.trap = *box; ni.search_dir = search_direction; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ bbox.X1 = bbox.Y1 = 0; bbox.X2 = PCB->MaxWidth; bbox.Y2 = PCB->MaxHeight; @@ -481,6 +483,8 @@ ComputeCost (NetListType *Nets, double T0, double T) lastbox = box; } END_LOOP; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ /* assess out of bounds penalty */ if (element->VBox.X1 < 0 || element->VBox.Y1 < 0 || @@ -624,6 +628,8 @@ createPerturbation (PointerListType *selected, double T) case 0: { /* shift! */ Coord grid; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ double scaleX = CLAMP (sqrt (T), MIL_TO_COORD (2.5), PCB->MaxWidth / 3); double scaleY = CLAMP (sqrt (T), MIL_TO_COORD (2.5), PCB->MaxHeight / 3); pt.which = SHIFT; @@ -636,6 +642,8 @@ createPerturbation (PointerListType *selected, double T) pt.DX = ((pt.DX / grid) + SGN (pt.DX)) * grid; pt.DY = ((pt.DY / grid) + SGN (pt.DY)) * grid; /* limit DX/DY so we don't fall off board */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pt.DX = MAX (pt.DX, -pt.element->VBox.X1); pt.DX = MIN (pt.DX, PCB->MaxWidth - pt.element->VBox.X2); pt.DY = MAX (pt.DY, -pt.element->VBox.Y1); diff --git a/src/autoroute.c b/src/autoroute.c index 494b09f..0d37df1 100644 --- a/src/autoroute.c +++ b/src/autoroute.c @@ -992,6 +992,7 @@ CreateRouteData () rd->max_keep = Settings.Keepaway; /* create styles structures */ bbox.X1 = bbox.Y1 = 0; + /* TODO: update this to use PCB->OutputExtents. */ bbox.X2 = PCB->MaxWidth; bbox.Y2 = PCB->MaxHeight; for (i = 0; i < NUM_STYLES + 1; i++) @@ -2261,6 +2262,8 @@ Expand (rtree_t * rtree, edge_t * e, const BoxType * box) * tree it might hit. The tree holds objects bloated by their own * keepaway so we are guaranteed to honor that. */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ switch (e->expand_dir) { case ALL: diff --git a/src/crosshair.c b/src/crosshair.c index f0526b8..37f5b73 100644 --- a/src/crosshair.c +++ b/src/crosshair.c @@ -1155,6 +1155,8 @@ MoveCrosshairAbsolute (Coord X, Coord Y) void SetCrosshairRange (Coord MinX, Coord MinY, Coord MaxX, Coord MaxY) { + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ Crosshair.MinX = MAX (0, MinX); Crosshair.MinY = MAX (0, MinY); Crosshair.MaxX = MIN (PCB->MaxWidth, MaxX); diff --git a/src/draw.c b/src/draw.c index 3738f6a..3578516 100644 --- a/src/draw.c +++ b/src/draw.c @@ -971,6 +971,8 @@ DrawMaskBoardArea (int mask_type, const BoxType *drawn_area) gui->use_mask (mask_type); gui->set_color (Output.fgGC, PCB->MaskColor); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (drawn_area == NULL) gui->fill_rect (Output.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight); else @@ -1087,6 +1089,8 @@ DrawLayer (LayerType *Layer, const BoxType *screen) /* We should check for gui->gui here, but it's kinda cool seeing the auto-outline magically disappear when you first add something to the "outline" layer. */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (IsLayerEmpty (Layer) && (strcmp (Layer->Name, "outline") == 0 || strcmp (Layer->Name, "route") == 0)) diff --git a/src/file.c b/src/file.c index 1f5c406..c3df49e 100644 --- a/src/file.c +++ b/src/file.c @@ -418,6 +418,8 @@ real_load_pcb (char *Filename, bool revert) Crosshair.Y = CLAMP (PCB->CursorY, 0, PCB->MaxHeight); /* update cursor confinement and output area (scrollbars) */ + /* TODO: as globals PCB-MaxHeight, PCB->MaxWidth are already set, + there's no need to send them as parameter. */ ChangePCBSize (PCB->MaxWidth, PCB->MaxHeight); /* enable default font if necessary */ @@ -531,6 +533,8 @@ PostLoadElementPCB () MoveElementLowLevel (yyPCB->Data, e, -e->BoundingBox.X1, -e->BoundingBox.Y1); PCB = pcb_save; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ yyPCB->MaxWidth = e->BoundingBox.X2; yyPCB->MaxHeight = e->BoundingBox.Y2; yyPCB->is_footprint = 1; @@ -602,6 +606,7 @@ WritePCBDataHeader (FILE * FP) fputs ("\nPCB[", FP); PrintQuotedString (FP, (char *)EMPTY (PCB->Name)); + /* TODO: update this to use PCB->OutputExtents. */ pcb_fprintf (FP, " %mr %mr]\n\n", PCB->MaxWidth, PCB->MaxHeight); pcb_fprintf (FP, "Grid[%s %mr %mr %d]\n", c_dtostr (COORD_TO_MIL (PCB->Grid) * 100), PCB->GridOffsetX, PCB->GridOffsetY, Settings.DrawGrid); pcb_fprintf (FP, "Cursor[%mr %mr %s]\n", diff --git a/src/fontmode.c b/src/fontmode.c index e09f825..16586b4 100644 --- a/src/fontmode.c +++ b/src/fontmode.c @@ -97,6 +97,8 @@ FontEdit (int argc, char **argv, Coord Ux, Coord Uy) { MoveLayerToGroup (l, l); } + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ PCB->MaxWidth = CELL_SIZE * 18; PCB->MaxHeight = CELL_SIZE * ((MAX_FONTPOSITION + 15) / 16 + 2); PCB->Grid = MIL_TO_COORD (5); @@ -150,6 +152,8 @@ FontEdit (int argc, char **argv, Coord Ux, Coord Uy) w, maxy + oy, MIL_TO_COORD (1), MIL_TO_COORD (1), NoFlags ()); } + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ for (l = 0; l < 16; l++) { int x = (l + 1) * CELL_SIZE; diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c index 8b969fa..36ea0c4 100644 --- a/src/hid/batch/batch.c +++ b/src/hid/batch/batch.c @@ -83,6 +83,8 @@ info (int argc, char **argv, Coord x, Coord y) return 0; } printf("Filename: %s\n", PCB->Filename); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n", PCB->MaxWidth, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c index 2f4cf34..6c94d5c 100644 --- a/src/hid/gcode/gcode.c +++ b/src/hid/gcode/gcode.c @@ -384,6 +384,8 @@ gcode_start_png (const char *layername) buf = g_strdup_printf ("%s.png", png_filename); free(png_filename); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ h = pcb_to_gcode (PCB->MaxHeight); w = pcb_to_gcode (PCB->MaxWidth); @@ -421,6 +423,8 @@ gcode_start_png_export () region.X1 = 0; region.Y1 = 0; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X2 = PCB->MaxWidth; region.Y2 = PCB->MaxHeight; @@ -579,6 +583,8 @@ gcode_do_export (HID_Attr_Val * options) fprintf (gcode_f2, "(Tool diameter: %f %s)\n", options[HA_tooldiameter].real_value * scale, metric ? "mm" : "inch"); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (metric) pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)\n", PCB->MaxWidth, PCB->MaxHeight); else @@ -721,6 +727,8 @@ gcode_do_export (HID_Attr_Val * options) { fprintf (gcode_f2, "(Drill diameter: %f mm)\n", drill->diameter_inches * 25.4); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pcb_fprintf (gcode_f2, "(Board size: %.2mmx%.2mm mm)\n", PCB->MaxWidth, PCB->MaxHeight); } @@ -728,6 +736,8 @@ gcode_do_export (HID_Attr_Val * options) { fprintf (gcode_f2, "(Drill diameter: %f inch)\n", drill->diameter_inches); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pcb_fprintf (gcode_f2, "(Board size: %.2mix%.2mi inches)\n", PCB->MaxWidth, PCB->MaxHeight); } @@ -1185,6 +1195,8 @@ gcode_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius) double diameter_inches = COORD_TO_INCH(radius*2); struct single_size_drills* drill = get_drill (diameter_inches); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ add_hole (drill, COORD_TO_INCH(PCB->MaxWidth - cx), /* convert to inch, flip: will drill from bottom side */ COORD_TO_INCH(PCB->MaxHeight - cy)); /* PCB reverses y axis */ diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c index 79c0447..0eb81f7 100644 --- a/src/hid/gerber/gerber.c +++ b/src/hid/gerber/gerber.c @@ -611,6 +611,8 @@ gerber_do_export (HID_Attr_Val * options) lastcap = -1; lastgroup = -1; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = 0; region.Y1 = 0; region.X2 = PCB->MaxWidth; @@ -793,6 +795,8 @@ gerber_set_layer (const char *name, int group, int empty) #endif fprintf (f, "G04 Format: Gerber/RS-274X *\r\n"); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pcb_fprintf (f, metric ? "G04 PCB-Dimensions (mm): %.2mm %.2mm *\r\n" : "G04 PCB-Dimensions (mil): %.2ml %.2ml *\r\n", PCB->MaxWidth, PCB->MaxHeight); @@ -865,6 +869,8 @@ gerber_set_layer (const char *name, int group, int empty) gui->set_line_width (gc, PCB->minWid); else gui->set_line_width (gc, AUTO_OUTLINE_WIDTH); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ gui->draw_line (gc, 0, 0, PCB->MaxWidth, 0); gui->draw_line (gc, 0, 0, 0, PCB->MaxHeight); gui->draw_line (gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c index 8e6cf22..e9dd83c 100644 --- a/src/hid/gtk/gtkhid-gdk.c +++ b/src/hid/gtk/gtkhid-gdk.c @@ -227,6 +227,8 @@ ghid_draw_bg_image (void) if (!ghidgui->bg_pixbuf) return; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ w = PCB->MaxWidth / gport->view.coord_per_px; h = PCB->MaxHeight / gport->view.coord_per_px; x = gport->view.x0 / gport->view.coord_per_px; @@ -736,11 +738,15 @@ redraw_region (GdkRectangle *rect) region.Y2 = MAX(Py(priv->clip_rect.y), Py(priv->clip_rect.y + priv->clip_rect.height + 1)); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1)); region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2)); region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1)); region.Y2 = MAX (0, MIN (PCB->MaxHeight, region.Y2)); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ eleft = Vx (0); eright = Vx (PCB->MaxWidth); etop = Vy (0); @@ -1133,6 +1139,8 @@ ghid_pinout_preview_expose (GtkWidget *widget, save_view = gport->view; save_width = gport->width; save_height = gport->height; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ save_max_width = PCB->MaxWidth; save_max_height = PCB->MaxHeight; @@ -1151,6 +1159,8 @@ ghid_pinout_preview_expose (GtkWidget *widget, gport->view.height = allocation.height * gport->view.coord_per_px; gport->view.x0 = (pinout->x_max - gport->view.width) / 2; gport->view.y0 = (pinout->y_max - gport->view.height) / 2; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ PCB->MaxWidth = pinout->x_max; PCB->MaxHeight = pinout->y_max; @@ -1197,6 +1207,8 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept gport->height = height; gport->view.width = width * gport->view.coord_per_px; gport->view.height = height * gport->view.coord_per_px; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ gport->view.x0 = gport->view.flip_x ? PCB->MaxWidth - cx : cx; gport->view.x0 -= gport->view.height / 2; gport->view.y0 = gport->view.flip_y ? PCB->MaxHeight - cy : cy; @@ -1211,6 +1223,8 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept region.X2 = MAX(Px(0), Px(gport->width + 1)); region.Y2 = MAX(Py(0), Py(gport->height + 1)); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1)); region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2)); region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1)); diff --git a/src/hid/gtk/gtkhid-gl.c b/src/hid/gtk/gtkhid-gl.c index 45b9b72..fdc5fd5 100644 --- a/src/hid/gtk/gtkhid-gl.c +++ b/src/hid/gtk/gtkhid-gl.c @@ -258,6 +258,8 @@ ghid_draw_bg_image (void) glEnable (GL_TEXTURE_2D); /* Render a quad with the background as a texture */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ glBegin (GL_QUADS); glTexCoord2d (0., 0.); @@ -633,6 +635,8 @@ static void draw_slanted_cross (gint x, gint y, gint z) { gint x0, y0, x1, y1; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ x0 = x + (PCB->MaxHeight - y); x0 = MAX(0, MIN (x0, PCB->MaxWidth)); @@ -662,6 +666,8 @@ draw_dozen_cross (gint x, gint y, gint z) { gint x0, y0, x1, y1; gdouble tan60 = sqrt (3); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ x0 = x + (PCB->MaxHeight - y) / tan60; x0 = MAX(0, MIN (x0, PCB->MaxWidth)); @@ -876,6 +882,8 @@ ghid_drawing_area_expose_cb (GtkWidget *widget, glScalef ((port->view.flip_x ? -1. : 1.) / port->view.coord_per_px, (port->view.flip_y ? -1. : 1.) / port->view.coord_per_px, ((port->view.flip_x == port->view.flip_y) ? 1. : -1.) / port->view.coord_per_px); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ glTranslatef (port->view.flip_x ? port->view.x0 - PCB->MaxWidth : -port->view.x0, port->view.flip_y ? port->view.y0 - PCB->MaxHeight : @@ -901,6 +909,8 @@ ghid_drawing_area_expose_cb (GtkWidget *widget, region.Y1 = MIN (Py (ev->area.y), Py (ev->area.y + ev->area.height + 1)); region.Y2 = MAX (Py (ev->area.y), Py (ev->area.y + ev->area.height + 1)); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = MAX (0, MIN (PCB->MaxWidth, region.X1)); region.X2 = MAX (0, MIN (PCB->MaxWidth, region.X2)); region.Y1 = MAX (0, MIN (PCB->MaxHeight, region.Y1)); @@ -910,6 +920,8 @@ ghid_drawing_area_expose_cb (GtkWidget *widget, port->bg_color.green / 65535., port->bg_color.blue / 65535.); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ glBegin (GL_QUADS); glVertex3i (0, 0, 0); glVertex3i (PCB->MaxWidth, 0, 0); @@ -977,6 +989,8 @@ ghid_pinout_preview_expose (GtkWidget *widget, save_view = gport->view; save_width = gport->width; save_height = gport->height; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ save_max_width = PCB->MaxWidth; save_max_height = PCB->MaxHeight; @@ -996,6 +1010,8 @@ ghid_pinout_preview_expose (GtkWidget *widget, gport->view.height = allocation.height * gport->view.coord_per_px; gport->view.x0 = (pinout->x_max - gport->view.width) / 2; gport->view.y0 = (pinout->y_max - gport->view.height) / 2; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ PCB->MaxWidth = pinout->x_max; PCB->MaxHeight = pinout->y_max; @@ -1039,6 +1055,8 @@ ghid_pinout_preview_expose (GtkWidget *widget, glScalef ((gport->view.flip_x ? -1. : 1.) / gport->view.coord_per_px, (gport->view.flip_y ? -1. : 1.) / gport->view.coord_per_px, ((gport->view.flip_x == gport->view.flip_y) ? 1. : -1.) / gport->view.coord_per_px); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ glTranslatef (gport->view.flip_x ? gport->view.x0 - PCB->MaxWidth : -gport->view.x0, gport->view.flip_y ? gport->view.y0 - PCB->MaxHeight : @@ -1060,6 +1078,8 @@ ghid_pinout_preview_expose (GtkWidget *widget, gport->view = save_view; gport->width = save_width; gport->height = save_height; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ PCB->MaxWidth = save_max_width; PCB->MaxHeight = save_max_height; @@ -1102,6 +1122,8 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept gport->height = height; gport->view.width = width * gport->view.coord_per_px; gport->view.height = height * gport->view.coord_per_px; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ gport->view.x0 = gport->view.flip_x ? PCB->MaxWidth - cx : cx; gport->view.x0 -= gport->view.height / 2; gport->view.y0 = gport->view.flip_y ? PCB->MaxHeight - cy : cy; @@ -1144,6 +1166,8 @@ ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int dept glScalef ((gport->view.flip_x ? -1. : 1.) / gport->view.coord_per_px, (gport->view.flip_y ? -1. : 1.) / gport->view.coord_per_px, ((gport->view.flip_x == gport->view.flip_y) ? 1. : -1.) / gport->view.coord_per_px); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ glTranslatef (gport->view.flip_x ? gport->view.x0 - PCB->MaxWidth : -gport->view.x0, gport->view.flip_y ? gport->view.y0 - PCB->MaxHeight : diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c index 88b9360..9e45b9a 100644 --- a/src/hid/gtk/gtkhid-main.c +++ b/src/hid/gtk/gtkhid-main.c @@ -34,6 +34,8 @@ pan_common (GHidPort *port) ghid_pcb_to_event_coords (gport->pcb_x, gport->pcb_y, &event_x, &event_y); /* Don't pan so far the board is completely off the screen */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ port->view.x0 = MAX (-port->view.width, port->view.x0); port->view.y0 = MAX (-port->view.height, port->view.y0); port->view.x0 = MIN ( port->view.x0, PCB->MaxWidth); @@ -122,6 +124,8 @@ ghid_zoom_view_rel (Coord center_x, Coord center_y, double factor) static void ghid_zoom_view_fit (void) { + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ ghid_pan_view_abs (SIDE_X (0), SIDE_Y (0), 0, 0); ghid_zoom_view_abs (SIDE_X (0), SIDE_Y (0), MAX (PCB->MaxWidth / gport->width, diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c index 2f2e3fb..64f288b 100644 --- a/src/hid/gtk/gui-config.c +++ b/src/hid/gtk/gui-config.c @@ -988,6 +988,8 @@ config_sizes_apply (void) ghidgui->config_modified = TRUE; } + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (PCB->MaxWidth != new_board_width || PCB->MaxHeight != new_board_height) ChangePCBSize (new_board_width, new_board_height); } @@ -1033,6 +1035,8 @@ config_sizes_tab_create (GtkWidget * tab_vbox) gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 3); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ new_board_width = PCB->MaxWidth; new_board_height = PCB->MaxHeight; ghid_table_coord_entry (table, 0, 0, NULL, diff --git a/src/hid/gtk/gui-output-events.c b/src/hid/gtk/gui-output-events.c index 2ca39de..9d0f515 100644 --- a/src/hid/gtk/gui-output-events.c +++ b/src/hid/gtk/gui-output-events.c @@ -82,6 +82,8 @@ ghid_port_ranges_scale (void) gport->view.height = gport->height * gport->view.coord_per_px; adj = gtk_range_get_adjustment (GTK_RANGE (ghidgui->h_range)); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ page_size = MIN (gport->view.width, PCB->MaxWidth); gtk_adjustment_configure (adj, gtk_adjustment_get_value (adj), /* value */ @@ -92,6 +94,8 @@ ghid_port_ranges_scale (void) page_size); /* page_size */ adj = gtk_range_get_adjustment (GTK_RANGE (ghidgui->v_range)); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ page_size = MIN (gport->view.height, PCB->MaxHeight); gtk_adjustment_configure (adj, gtk_adjustment_get_value (adj), /* value */ diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h index f2585f7..7fad982 100644 --- a/src/hid/gtk/gui.h +++ b/src/hid/gtk/gui.h @@ -61,6 +61,8 @@ #define FROM_PCB_UNITS(v) coord_to_unit (Settings.grid_unit, v) #define TO_PCB_UNITS(v) unit_to_coord (Settings.grid_unit, v) + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ #define SIDE_X(x) ((gport->view.flip_x ? PCB->MaxWidth - (x) : (x))) #define SIDE_Y(y) ((gport->view.flip_y ? PCB->MaxHeight - (y) : (y))) diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c index 59a44c8..396f14a 100644 --- a/src/hid/lesstif/dialogs.c +++ b/src/hid/lesstif/dialogs.c @@ -1146,6 +1146,8 @@ sz_val2str (Widget w, Coord u, int pcbu) static void sizes_set () { + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ PCB->MaxWidth = sz_str2val (sz_pcb_w, 1); PCB->MaxHeight = sz_str2val (sz_pcb_h, 1); PCB->Bloat = sz_str2val (sz_bloat, 1); @@ -1163,6 +1165,8 @@ sizes_set () Settings.minDrill = PCB->minDrill; Settings.minRing = PCB->minRing; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ SetCrosshairRange (0, 0, PCB->MaxWidth, PCB->MaxHeight); lesstif_pan_fixup (); } @@ -1173,6 +1177,8 @@ lesstif_sizes_reset () char *ls; if (!sizes_dialog) return; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ sz_val2str (sz_pcb_w, PCB->MaxWidth, 1); sz_val2str (sz_pcb_h, PCB->MaxHeight, 1); sz_val2str (sz_bloat, PCB->Bloat, 1); diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c index 8756aa5..84bd5ea 100644 --- a/src/hid/lesstif/main.c +++ b/src/hid/lesstif/main.c @@ -365,6 +365,8 @@ PointCursor (int argc, char **argv, Coord x, Coord y) static int PCBChanged (int argc, char **argv, Coord x, Coord y) { + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (work_area == 0) return 0; /*pcb_printf("PCB Changed! %$mD\n", PCB->MaxWidth, PCB->MaxHeight); */ @@ -1108,6 +1110,8 @@ DrawBackgroundImage () { int x, y, w, h; double xscale, yscale; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ int pcbwidth = PCB->MaxWidth / view_zoom; int pcbheight = PCB->MaxHeight / view_zoom; @@ -1130,6 +1134,8 @@ DrawBackgroundImage () w = MIN (view_width, pcbwidth); h = MIN (view_height, pcbheight); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ xscale = (double)bg_w / PCB->MaxWidth; yscale = (double)bg_h / PCB->MaxHeight; @@ -3771,6 +3777,8 @@ pinout_callback (Widget da, PinoutData * pd, use_mask = 0; flip_x = flip_y = 0; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = 0; region.Y1 = 0; region.X2 = PCB->MaxWidth; diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c index 048f476..9c05521 100644 --- a/src/hid/nelma/nelma.c +++ b/src/hid/nelma/nelma.c @@ -600,6 +600,8 @@ nelma_start_png(const char *basename, const char *suffix) buf = nelma_get_png_name(basename, suffix); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ h = pcb_to_nelma(PCB->MaxHeight); w = pcb_to_nelma(PCB->MaxWidth); @@ -637,6 +639,8 @@ nelma_start_png_export() { BoxType region; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = 0; region.Y1 = 0; region.X2 = PCB->MaxWidth; diff --git a/src/hid/png/png.c b/src/hid/png/png.c index c7c0efd..f43cbe5 100644 --- a/src/hid/png/png.c +++ b/src/hid/png/png.c @@ -73,6 +73,8 @@ static int show_solder_side; #define SWAP_IF_SOLDER(a,b) do { Coord c; if (show_solder_side) { c=a; a=b; b=c; }} while (0) /* Used to detect non-trivial outlines */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ #define NOT_EDGE_X(x) ((x) != 0 && (x) != PCB->MaxWidth) #define NOT_EDGE_Y(y) ((y) != 0 && (y) != PCB->MaxHeight) #define NOT_EDGE(x,y) (NOT_EDGE_X(x) || NOT_EDGE_Y(y)) @@ -549,6 +551,8 @@ png_hid_export_to_file (FILE * the_file, HID_Attr_Val * options) f = the_file; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = 0; region.Y1 = 0; region.X2 = PCB->MaxWidth; @@ -834,6 +838,8 @@ png_do_export (HID_Attr_Val * options) filename = "pcb-out.png"; /* figure out width and height of the board */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (options[HA_only_visible].int_value) { bbox = GetDataBoundingBox (PCB->Data); @@ -1628,6 +1634,8 @@ png_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) /* Special case - lines drawn along the bottom or right edges are brought in by a pixel to make sure we have contiguous outlines. */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (x1 == PCB->MaxWidth && x2 == PCB->MaxWidth) { x1 -= scale/2; diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c index ba27023..1fd3cc1 100644 --- a/src/hid/ps/eps.c +++ b/src/hid/ps/eps.c @@ -198,6 +198,8 @@ eps_hid_export_to_file (FILE * the_file, HID_Attr_Val * options) f = the_file; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ region.X1 = 0; region.Y1 = 0; region.X2 = PCB->MaxWidth; diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c index 31eea9d..27566e0 100644 --- a/src/hid/ps/ps.c +++ b/src/hid/ps/ps.c @@ -626,6 +626,8 @@ ps_hid_export_to_file (FILE * the_file, HID_Attr_Val * options) if (the_file) ps_start_file (the_file); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (global.fillpage) { double zx, zy; @@ -673,6 +675,8 @@ ps_hid_export_to_file (FILE * the_file, HID_Attr_Val * options) ps_set_layer (NULL, 0, -1); use_gc (NULL); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ global.region.X1 = 0; global.region.Y1 = 0; global.region.X2 = PCB->MaxWidth; @@ -906,6 +910,8 @@ ps_set_layer (const char *name, int group, int empty) global.media_width / 2, global.media_height / 2); boffset = global.media_height / 2; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (PCB->MaxWidth > PCB->MaxHeight) { fprintf (global.f, "90 rotate\n"); @@ -920,6 +926,8 @@ ps_set_layer (const char *name, int group, int empty) fprintf (global.f, "%g dup neg scale\n", (SL_TYPE (idx) == SL_FAB) ? 1.0 : global.scale_factor); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pcb_fprintf (global.f, "%mi %mi translate\n", -PCB->MaxWidth / 2, -PCB->MaxHeight / 2); /* Keep the drill list from falling off the left edge of the paper, @@ -948,6 +956,8 @@ ps_set_layer (const char *name, int group, int empty) if ((global.outline && !global.outline_layer) || global.invert) { + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ pcb_fprintf (global.f, "0 setgray 0 setlinewidth 0 0 moveto 0 " "%mi lineto %mi %mi lineto %mi 0 lineto closepath %s\n", @@ -958,6 +968,8 @@ ps_set_layer (const char *name, int group, int empty) if (global.align_marks) { corner (global.f, 0, 0, -1, -1); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ corner (global.f, PCB->MaxWidth, 0, 1, -1); corner (global.f, PCB->MaxWidth, PCB->MaxHeight, 1, 1); corner (global.f, 0, PCB->MaxHeight, -1, 1); diff --git a/src/misc.c b/src/misc.c index 4197580..73fbc4b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1832,6 +1832,8 @@ AttachForCopy (Coord PlaceX, Coord PlaceY) Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3); + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ SetCrosshairRange (Crosshair.AttachedObject.X - box->X1, Crosshair.AttachedObject.Y - box->Y1, PCB->MaxWidth - (box->X2 - Crosshair.AttachedObject.X), diff --git a/src/print.c b/src/print.c index 972d13e..1c29d3c 100644 --- a/src/print.c +++ b/src/print.c @@ -309,6 +309,8 @@ PrintFab (hidGC gc) break; } } + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if (i == max_copper_layer) { gui->set_line_width (gc, MIL_TO_COORD(10)); @@ -349,6 +351,8 @@ PrintFab (hidGC gc) DrawTextLowLevel (text, 0); } END_LOOP; + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ gui->set_line_width (gc, FAB_LINE_W); text_at (gc, PCB->MaxWidth / 2, PCB->MaxHeight + MIL_TO_COORD(20), 1, "Board outline is the centerline of this path"); diff --git a/src/set.c b/src/set.c index 21351da..68cc1a0 100644 --- a/src/set.c +++ b/src/set.c @@ -186,6 +186,8 @@ SetCrosshairRangeToBuffer (void) SetBufferBoundingBox (PASTEBUFFER); SetCrosshairRange (PASTEBUFFER->X - PASTEBUFFER->BoundingBox.X1, PASTEBUFFER->Y - PASTEBUFFER->BoundingBox.Y1, + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ PCB->MaxWidth - (PASTEBUFFER->BoundingBox.X2 - PASTEBUFFER->X), PCB->MaxHeight - @@ -314,6 +316,8 @@ SetMode (int Mode) /* do an update on the crosshair range */ SetCrosshairRangeToBuffer (); else + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ SetCrosshairRange (0, 0, PCB->MaxWidth, PCB->MaxHeight); recursing = false; diff --git a/src/toporouter.c b/src/toporouter.c index 0a83569..66e3a05 100644 --- a/src/toporouter.c +++ b/src/toporouter.c @@ -251,6 +251,8 @@ toporouter_output_init(int w, int h, char *filename) dc->filename = filename; /* Calculate scaling to maintain aspect ratio */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ if(PCB->MaxWidth > PCB->MaxHeight) { /* Scale board width to match image width minus 2xMARGIN */ dc->s = ((double)dc->iw - (2 * MARGIN)) / (double)PCB->MaxWidth; @@ -2031,6 +2033,8 @@ read_board_constraints (toporouter_t *r, toporouter_layer_t *l, int layer) toporouter_bbox_t *bbox; /* Create points for the board edges and constrain those edges */ + /* TODO: update this to use PCB->OutputExtents instead of + PCB->MaxWidth and PCB->MaxHeight. */ create_board_edge (0., 0., PCB->MaxWidth, 0., layer, &vlist); create_board_edge (PCB->MaxWidth, 0., PCB->MaxWidth, PCB->MaxHeight, layer, &vlist); create_board_edge (PCB->MaxWidth, PCB->MaxHeight, 0., PCB->MaxHeight, layer, &vlist); -- 1.7.9.5 --------------090108040108020200070700--