Closed khiemdnt closed 2 years ago
Hi, @khiemdnt , I think you can try to set it according to mLastDrawArea
field, please refer to the draw codes:
override fun render(canvas: Canvas) {
canvas.save()
canvas.translate(mLastDrawArea.left.toFloat(), (mLastDrawArea.top + mLastDrawArea.bottom) / 2F)
mRenderColumns.forEach {
canvas.drawRoundRect(it, mRadius, mRadius, mPaint)
}
canvas.restore()
}
@bogerchan tks. I found solution and set width = canvas.width.toFloat() override fun render(canvas: Canvas) { canvas.save() mPaint.shader = LinearGradient( 0f, 0f, canvas.width.toFloat(), 0f, Color.parseColor("#FF7050"), Color.parseColor("#B42F8F"), Shader.TileMode.MIRROR ) canvas.translate( mLastDrawArea.left.toFloat(), (mLastDrawArea.top + mLastDrawArea.bottom) / 2F ) mRenderColumns.forEach { canvas.drawRoundRect(it, mRadius, mRadius, mPaint) } canvas.restore() }
Hi I doing custom ColumnarType1Renderer implement IRenderer. I want to set LinearGradient but i don't know position x0, y0, x1, y1 of wave ColumnarType1Renderer. mPaint.shader = LinearGradient( 0f, 0f, 0f, 0f, Color.parseColor("#FF7050"), Color.parseColor("#B42F8F"), Shader.TileMode.MIRROR ) So. I want to know position to set gradient wave music ColumnarType1Renderer. Please , help me Tks so much