summaryrefslogtreecommitdiff
path: root/app/bin/track.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/track.c')
-rw-r--r--app/bin/track.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/app/bin/track.c b/app/bin/track.c
index 951eec3..7de4f4a 100644
--- a/app/bin/track.c
+++ b/app/bin/track.c
@@ -193,13 +193,16 @@ EXPORT track_p OnTrack2( coOrd * fp, BOOL_T complain, BOOL_T track,
}
}
- p = *fp;
- distance = trackCmds( GetTrkType(trk) )->distance( trk, &p );
- if (fabs(distance) <= fabs(
- closestDistance)) { //Make the last (highest) preferred
- closestDistance = distance;
- closestTrack = trk;
- closestPos = p;
+ if ( GetCurrentCommand() != modifyCmdInx ||
+ FALSE == QueryTrack( trk, Q_IS_TEXT ) ) {
+ p = *fp;
+ distance = trackCmds( GetTrkType(trk) )->distance( trk, &p );
+ if (fabs(distance) <= fabs(
+ closestDistance)) { //Make the last (highest) preferred
+ closestDistance = distance;
+ closestTrack = trk;
+ closestPos = p;
+ }
}
}
if (closestTrack && closestDistance <0 ) { closestDistance = 0.0; } //Turntable was closest - inside well
@@ -1512,15 +1515,15 @@ EXPORT void SelectBelow( void * unused )
}
-#include "bitmaps/top.xpm3"
-#include "bitmaps/bottom.xpm3"
+#include "bitmaps/top.image3"
+#include "bitmaps/bottom.image3"
EXPORT void InitCmdAboveBelow( void )
{
wIcon_p bm_p;
- bm_p = wIconCreatePixMap( top_xpm3[iconSize] );
+ bm_p = wIconCreatePixMap( top_image3[iconSize] );
AddToolbarButton( "cmdAbove", bm_p, IC_SELECTED|IC_POPUP, SelectAbove, NULL );
- bm_p = wIconCreatePixMap( bottom_xpm3[iconSize] );
+ bm_p = wIconCreatePixMap( bottom_image3[iconSize] );
AddToolbarButton( "cmdBelow", bm_p, IC_SELECTED|IC_POPUP, SelectBelow, NULL );
}
@@ -2819,6 +2822,9 @@ EXPORT void DrawTie(
return;
}
}
+ if ( color == wDrawColorBlack ) {
+ color = tieColor;
+ }
if ( solid ) {
DrawPoly( d, 4, p, t, color, 0, DRAW_FILL );
} else {
@@ -2827,6 +2833,20 @@ EXPORT void DrawTie(
}
+/**
+ * Return base color of a track
+ * Detect
+ * - grade, radius exception
+ * - profile path
+ * - layer override
+ * - Cornu/Bezier too tight
+ * These are used for track and ties
+ * If not, return Black. Which is converted to normalColor/tieColor before use
+ *
+ * \param trk track object
+ * \param d draw context
+ * \return track color
+ */
EXPORT wDrawColor GetTrkColor( track_p trk, drawCmd_p d )
{
DIST_T len, elev0, elev1;