src/hg/hgTracks/hgTracks.c 1.1637
1.1637 2010/04/08 18:36:46 kent
Fixing indentation and putting function comment in right place. Code standards people!
Index: src/hg/hgTracks/hgTracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/hgTracks.c,v
retrieving revision 1.1636
retrieving revision 1.1637
diff -b -B -U 4 -r1.1636 -r1.1637
--- src/hg/hgTracks/hgTracks.c 2 Apr 2010 20:14:15 -0000 1.1636
+++ src/hg/hgTracks/hgTracks.c 8 Apr 2010 18:36:46 -0000 1.1637
@@ -1567,11 +1567,12 @@
}
return vis;
}
-static int makeRulerZoomBoxes(struct hvGfx *hvg, struct cart *cart,int winStart,int winEnd,int insideWidth,int seqBaseCount,int rulerClickY,int rulerClickHeight)
-{
+static int makeRulerZoomBoxes(struct hvGfx *hvg, struct cart *cart, int winStart,int winEnd,
+ int insideWidth,int seqBaseCount,int rulerClickY,int rulerClickHeight)
/* Make hit boxes that will zoom program around ruler. */
+{
int boxes = 30;
int winWidth = winEnd - winStart;
int newWinWidth = winWidth;
int i, ws, we = 0, ps, pe = 0;
@@ -1623,35 +1624,36 @@
}
return newWinWidth;
}
-static int doDrawRuler(struct hvGfx *hvg,int *newWinWidth,int *rulerClickHeight,int rulerHeight,int yAfterRuler,
- int yAfterBases, MgFont *font,int fontHeight,boolean rulerCds)
-{
+static int doDrawRuler(struct hvGfx *hvg,int *newWinWidth,int *rulerClickHeight,
+ int rulerHeight, int yAfterRuler, int yAfterBases, MgFont *font,
+ int fontHeight,boolean rulerCds)
/* draws the ruler. */
+{
int scaleBarPad = 2;
int scaleBarHeight = fontHeight;
int scaleBarTotalHeight = fontHeight + 2 * scaleBarPad;
int titleHeight = fontHeight;
int baseHeight = fontHeight;
//int yAfterBases = yAfterRuler;
int showPosHeight = fontHeight;
int codonHeight = fontHeight;
- struct dnaSeq *seq = NULL;
- int rulerClickY = 0;
- *rulerClickHeight = rulerHeight;
-
- int y = rulerClickY;
- hvGfxSetClip(hvg, insideX, y, insideWidth, yAfterRuler-y+1);
- int relNumOff = winStart;
+struct dnaSeq *seq = NULL;
+int rulerClickY = 0;
+*rulerClickHeight = rulerHeight;
+
+int y = rulerClickY;
+hvGfxSetClip(hvg, insideX, y, insideWidth, yAfterRuler-y+1);
+int relNumOff = winStart;
- if (baseTitle)
+if (baseTitle)
{
hvGfxTextCentered(hvg, insideX, y, insideWidth, titleHeight,MG_BLACK, font, baseTitle);
*rulerClickHeight += titleHeight;
y += titleHeight;
}
- if (baseShowPos||baseShowAsm)
+if (baseShowPos||baseShowAsm)
{
char txt[256];
char numBuf[SMALLBUF];
char *freezeName = NULL;
@@ -1659,9 +1661,10 @@
sprintLongWithCommas(numBuf, winEnd-winStart);
if(freezeName == NULL)
freezeName = "Unknown";
if (baseShowPos&&baseShowAsm)
- safef(txt,sizeof(txt),"%s %s %s (%s bp)",organism,freezeName,addCommasToPos(database, position),numBuf);
+ safef(txt,sizeof(txt),"%s %s %s (%s bp)",organism,
+ freezeName, addCommasToPos(database, position), numBuf);
else if (baseShowPos)
safef(txt,sizeof(txt),"%s (%s bp)",addCommasToPos(database, position),numBuf);
else
safef(txt,sizeof(txt),"%s %s",organism,freezeName);
@@ -1669,9 +1672,9 @@
*rulerClickHeight += showPosHeight;
freez(&freezeName);
y += showPosHeight;
}
- if (baseShowScaleBar)
+if (baseShowScaleBar)
{
char scaleText[32];
int numBases = winEnd-winStart;
int scaleBases = computeScaleBar(numBases, scaleText, sizeof(scaleText));
@@ -1688,16 +1691,16 @@
hvGfxLine(hvg, scaleBarEndX, y+scaleBarPad, scaleBarEndX,
y+scaleBarTotalHeight-scaleBarPad, MG_BLACK);
y += scaleBarTotalHeight;
}
- if (baseShowRuler)
+if (baseShowRuler)
{
hvGfxDrawRulerBumpText(hvg, insideX, y, rulerHeight, insideWidth, MG_BLACK,
font, relNumOff, winBaseCount, 0, 1);
}
- *newWinWidth = makeRulerZoomBoxes(hvg, cart,winStart,winEnd,insideWidth,seqBaseCount,rulerClickY,*rulerClickHeight);
+*newWinWidth = makeRulerZoomBoxes(hvg, cart,winStart,winEnd,insideWidth,seqBaseCount,rulerClickY,*rulerClickHeight);
- if (zoomedToBaseLevel || rulerCds)
+if (zoomedToBaseLevel || rulerCds)
{
Color baseColor = MG_BLACK;
int start, end, chromSize;
struct dnaSeq *extraSeq;
@@ -1786,9 +1789,9 @@
zoomedToCodonLevel);
}
}
}
- hvGfxUnclip(hvg);
+hvGfxUnclip(hvg);
return y;
}
void makeActiveImage(struct track *trackList, char *psOutput)