@@ -68,15 +68,15 @@ struct SetPixelData
68
68
69
69
static void SetPixels (const SetPixelData& spd, int x, double tor, uint32_t color)
70
70
{
71
- int y = std::clamp ((int )((tor - spd.startOfs ) * spd.pixPerOfs , 0 , MAP_HEIGHT - 1 );
71
+ int y = std::clamp ((int )((tor - spd.startOfs ) * spd.pixPerOfs ) , 0 , MAP_HEIGHT - 1 );
72
72
uint32_t * dst = spd.pixels + y * MAP_WIDTH + x;
73
73
for (int i = 0 ; i < spd.noteW ; ++i, ++dst) *dst = color;
74
74
}
75
75
76
76
static void SetPixels (const SetPixelData& spd, int x, double tor, double end, uint32_t color)
77
77
{
78
- int yt = std::clamp ((int )((tor - spd.startOfs ) * spd.pixPerOfs , 0 , MAP_HEIGHT - 1 );
79
- int yb = std::clamp ((int )((end - spd.startOfs ) * spd.pixPerOfs , 0 , MAP_HEIGHT - 1 );
78
+ int yt = std::clamp ((int )((tor - spd.startOfs ) * spd.pixPerOfs ) , 0 , MAP_HEIGHT - 1 );
79
+ int yb = std::clamp ((int )((end - spd.startOfs ) * spd.pixPerOfs ) , 0 , MAP_HEIGHT - 1 );
80
80
for (int y = yt; y <= yb; ++y)
81
81
{
82
82
uint32_t * dst = spd.pixels + y * MAP_WIDTH + x;
@@ -198,7 +198,7 @@ static void SetDensityRow(uint32_t* pixels, int y, double density)
198
198
int b = BlendI32 (colors[ci + 2 ], colors[ci + 5 ], bf);
199
199
uint32_t col = Color32 (r, g, b);
200
200
201
- int w = std::clamp ((int )(density * 0.05 , 4 , MAP_WIDTH) / 2 ;
201
+ int w = std::clamp ((int )(density * 0.05 ) , 4 , MAP_WIDTH) / 2 ;
202
202
uint32_t * dst = pixels + y * MAP_WIDTH + MAP_WIDTH / 2 - w;
203
203
for (int i = -w; i < w; ++i, ++dst) *dst = col;
204
204
}
@@ -283,7 +283,7 @@ double myGetMapOffset(int y)
283
283
topY = chartRect.y ;
284
284
bottomY = chartRect.y + chartRect.h ;
285
285
286
- double t = std::clamp ((double )(y - topY) / (double )(bottomY - topY, 0.0 , 1.0 );
286
+ double t = std::clamp ((double )(y - topY) / (double )(bottomY - topY) , 0.0 , 1.0 );
287
287
if (gView ->hasReverseScroll ()) t = 1.0 - t;
288
288
289
289
tor = myChartBeginOfs + (myChartEndOfs - myChartBeginOfs) * t;
0 commit comments