Skip to content

Commit fcd5482

Browse files
shai-almogclaude
andcommitted
charts: add CN1SS:DBG enter/bounds/exit logging in XYChart.draw
The CN1SS:DBG:ChartComponent.paint output from commit 36137d1 showed chart-line on iOS GL gets a 38ms first paint at gxT=825 then two 3ms post-transition paints at gxT=0, with no exception bubbling up. Round charts on the same harness pattern paint correctly. Adding entry, bounds (left/top/right/legendSize) and exit logging inside XYChart.draw narrows down whether the iOS XY chart paint is actually running through the full draw or bailing inside one of the early checks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 36137d1 commit fcd5482

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

CodenameOne/src/com/codename1/charts/views/XYChart.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,18 @@ protected void setDatasetRenderer(XYMultipleSeriesDataset dataset,
101101
/// - `paint`: the paint
102102
@Override
103103
public void draw(Canvas canvas, int x, int y, int width, int height, Paint paint) {
104+
System.out.println("CN1SS:DBG:XYChart.draw:enter cls=" + getClass().getSimpleName()
105+
+ " x=" + x + " y=" + y + " w=" + width + " h=" + height
106+
+ " antialias=" + mRenderer.isAntialiasing());
104107
paint.setAntiAlias(mRenderer.isAntialiasing());
105108
int legendSize = getLegendSize(mRenderer, height / 5, mRenderer.getAxisTitleTextSize());
106109
int[] margins = mRenderer.getMargins();
107110
int left = x + margins[1] + (int) mRenderer.getAxisTitleTextSize() + (mRenderer.isShowLabels() ? (int) mRenderer.getLabelsTextSize() : 0);
108111
int top = y + margins[0];
109112
int right = x + width - margins[3];
113+
System.out.println("CN1SS:DBG:XYChart.draw:bounds left=" + left + " top=" + top
114+
+ " right=" + right + " legendSize=" + legendSize + " axisTitleTextSize=" + (int) mRenderer.getAxisTitleTextSize()
115+
+ " margins=[" + margins[0] + "," + margins[1] + "," + margins[2] + "," + margins[3] + "]");
110116
int sLength = mDataset.getSeriesCount();
111117
String[] titles = new String[sLength];
112118
for (int i = 0; i < sLength; i++) {
@@ -158,6 +164,7 @@ public void draw(Canvas canvas, int x, int y, int width, int height, Paint paint
158164
}
159165
maxScaleNumber++;
160166
if (maxScaleNumber < 0) {
167+
System.out.println("CN1SS:DBG:XYChart.draw:earlyReturn maxScaleNumber=" + maxScaleNumber);
161168
return;
162169
}
163170
double[] minX = new double[maxScaleNumber];
@@ -494,6 +501,7 @@ public void draw(Canvas canvas, int x, int y, int width, int height, Paint paint
494501
if (rotate) {
495502
transform(canvas, angle, true);
496503
}
504+
System.out.println("CN1SS:DBG:XYChart.draw:exit cls=" + getClass().getSimpleName());
497505
}
498506

499507
protected List<Double> getXLabels(double min, double max, int count) {

0 commit comments

Comments
 (0)