2e8e0086e36251107884419892402f41f860ef03 jcasper Tue Mar 18 18:12:10 2025 -0700 Fixing hvGfxCurve to correctly relocate the three points in reverse-complement, refs #35408 diff --git src/hg/inc/hvGfx.h src/hg/inc/hvGfx.h index 689eb7d6521..683f4642ad4 100644 --- src/hg/inc/hvGfx.h +++ src/hg/inc/hvGfx.h @@ -257,31 +257,36 @@ * Point 0 is left, point 1 is top of rectangle. */ { x1 = hvGfxAdjXX(hvg, x1, &x2, &y1, &y2); // NOTE: dashed mode may cause a hang, so disabling for now vgEllipse(hvg->vg, x1, y1, x2, y2, color, mode, FALSE); } INLINE int hvGfxCurve(struct hvGfx *hvg, int x1, int y1, int x2, int y2, int x3, int y3, Color color, boolean isDashed) /* Draw a segment of an anti-aliased curve within 3 points (quadratic Bezier) * Return max y value. Optionally draw curve as dashed line. * Adapted trivially from code posted at http://members.chello.at/~easyfilter/bresenham.html * Author: Zingl Alois, 8/22/2016 */ { -x1 = hvGfxAdjXX(hvg, x1, &x2, &y1, &y2); +x1 = hvGfxAdjXX(hvg, x1, &x3, &y1, &y3); + +// also have to manually adjust the x value of the middle coordinate +// This is just like the transformation being done in reverseIntRange for x1 and x3 +if (hvg->rc) + x2 = hvg->width - x2; return vgCurve(hvg->vg, x1, y1, x2, y2, x3, y3, color, isDashed); } INLINE int hvGfxFindColorIx(struct hvGfx *hvg, int r, int g, int b) /* Find color in map if possible, otherwise create new color or * in a pinch a close color. */ { return vgFindColorIx(hvg->vg, r, g, b); } INLINE int hvGfxFindAlphaColorIx(struct hvGfx *hvg, int r, int g, int b, int a) /* Find color in map if possible, otherwise create new color or * in a pinch a close color. */ { return vgFindAlphaColorIx(hvg->vg, r, g, b, a);