Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border box of Text not showing properly in CENTER or RIGHT text alignment #93

Open
mianaliasjad opened this issue Apr 4, 2020 · 1 comment

Comments

@mianaliasjad
Copy link

mianaliasjad commented Apr 4, 2020

Hi,
If we set the text alignment to center in TextStickerView then the border square box of text becomes broken.
You just have to change text alignment on this line and run the app then add text.

Screenshot_2020-04-04-12-20-32

@meysam-mo
Copy link

meysam-mo commented Mar 9, 2023

i solved this issue with change below code in TextStickerView.java Line: 252

for (int i = 0; i < mTextContents.size(); i++) {
   int alignX = x;
   if (mPaint.getTextAlign() == Paint.Align.CENTER)
      alignX = (int) ((rect.left + rect.right)/2);

   else if (mPaint.getTextAlign() == Paint.Align.RIGHT)
      alignX = (int) rect.right;

   else if (mPaint.getTextAlign() == Paint.Align.LEFT)
      alignX = (int) rect.left;

   canvas.drawText(mTextContents.get(i), alignX, draw_text_y, mPaint);
   draw_text_y += text_height;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants