void JoystickHistoryView::Draw(UIContext &dc) { if (xAxis_ > -1 && yAxis_ > -1) { const AtlasImage &image = dc.Draw()->GetAtlas()->images[I_CROSS]; float minRadius = std::min(bounds_.w, bounds_.h) * 0.5f - image.w; int a = maxCount_ - (int)locations_.size(); for (auto iter = locations_.begin(); iter != locations_.end(); ++iter) { float x = bounds_.centerX() + minRadius * iter->x; float y = bounds_.centerY() - minRadius * iter->y; float alpha = (float)a / maxCount_; if (alpha < 0.0f) alpha = 0.0f; dc.Draw()->DrawImage(I_CROSS, x, y, 0.8f, colorAlpha(0xFFFFFF, alpha), ALIGN_CENTER); a++; } dc.End(); dc.BeginNoTex(); dc.Draw()->RectOutline(bounds_.centerX() - minRadius, bounds_.centerY() - minRadius, minRadius * 2, minRadius * 2, 0x80FFFFFF); dc.End(); dc.Begin(); } else { dc.DrawText("N/A", bounds_.centerX(), bounds_.centerY(), 0xFFFFFFFF, ALIGN_CENTER); } }