Skip to content

correcting_anchor_point for bitmap_label Upwards and Downwards direction #152

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

Merged
merged 1 commit into from
Jun 22, 2021
Merged

correcting_anchor_point for bitmap_label Upwards and Downwards direction #152

merged 1 commit into from
Jun 22, 2021

Conversation

jposada202020
Copy link
Contributor

This will correct some small glitches with the anchor point for bitmap_label for the UPR and DWR direction

Test Code

import displayio
import board
from adafruit_display_text import bitmap_label
from adafruit_bitmap_font import bitmap_font

display = board.DISPLAY

main_group = displayio.Group(max_size=10)
MEDIUM_FONT = bitmap_font.load_font("fonts/Helvetica-Bold-16.bdf")
LINE_HOR = displayio.Bitmap(4, display.height, 2)
LINE_VER = displayio.Bitmap(display.width, 4, 2)
COLOR = 0x990099
palette = displayio.Palette(2)
palette[0] = 0x004400
palette[1] = 0x00FFFF


text_area_UPR = bitmap_label.Label(MEDIUM_FONT,
                                   text="Upwards-1.0",
                                   label_direction="UPR",
                                   background_color=COLOR,
                                   anchored_position=(200, 200),
                                   anchor_point=(1.0, 1.0),
                                    )

text_area_UPR2 = bitmap_label.Label(MEDIUM_FONT,
                                    text="Upwards-0.5",
                                    label_direction="UPR",
                                    background_color=COLOR,
                                    anchored_position=(230, 200),
                                    anchor_point=(1.0, 0.5),
                                    )

text_area_UPR3 = bitmap_label.Label(MEDIUM_FONT,
                                    text="Upwards-0.0", label_direction="UPR",
                                    background_color=COLOR,
                                    anchored_position=(260, 200),
                                    anchor_point=(1.0, 0.0),
                                    )

line_ver = displayio.TileGrid(LINE_VER, pixel_shader=palette, x=0, y=200)
line_hor = displayio.TileGrid(LINE_HOR, pixel_shader=palette, x=200, y=0)
main_group.append(line_ver)
main_group.append(line_hor)

main_group.append(text_area_UPR)
main_group.append(text_area_UPR2)
main_group.append(text_area_UPR3)
display.show(main_group)

while True:
    pass

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit 1f27ba7 into adafruit:main Jun 22, 2021
@jposada202020 jposada202020 deleted the correcting_bitmaplabel_anchorpoint branch June 22, 2021 03:12
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 25, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.9.4 from 2.9.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#53 from cdmuhlb/issues/52-ssd1680-stride
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.2.0 from 3.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#45 from lesamouraipourpre/matrix5x5
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_LC709203F to 2.1.0 from 2.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_LC709203F#14 from jposada202020/correcting_docs
  > Merge pull request adafruit/Adafruit_CircuitPython_LC709203F#13 from dgriswo/main
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.18.5 from 2.18.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#152 from jposada202020/correcting_bitmaplabel_anchorpoint
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_NeoKey
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

Successfully merging this pull request may close these issues.

2 participants