pygame-menu icon indicating copy to clipboard operation
pygame-menu copied to clipboard

Dropselect content position incorrect during floating + translate

Open jsgithub20 opened this issue 1 year ago • 1 comments

Environment information Describe your environment information, such as:

  • SO: win
  • python version: v3.10
  • pygame version: v2.1.2
  • pygame-menu version: v4.2.8

Describe the bug When the Dropselect widget is set to float with a "translate" position, the content box (pull-down list) occurs away from the Dropselect widget when clicking the arrow to the right end of the Dropselect widget

To Reproduce The following code reproduce the phenomenon selector_map = sub_menu1.add.dropselect( title='', items=[("Map0", 0), ("Map1", 1), ("Map3", 2)], font_size=26, selection_box_width=173, selection_box_height=100, selection_option_padding=(0, 5), selection_option_font_size=20 ) selector_map.set_float(True, False, True) selector_map.translate(650, 100)

Expected behavior When the Dropselect widget is move to a "translate" position, the pull-down list should occur at the normal position when clicked.

Additional context Making the following change (remark the two lines) to "dropselect.py" fix this issue: def translate(self, x: NumberType, y: NumberType) -> 'DropSelect': super(DropSelect, self).translate(x, y) # if self._drop_frame is not None: # self._drop_frame.translate(x, y) return self

jsgithub20 avatar Aug 05 '22 12:08 jsgithub20

Hi, I'll check it out asap :)

ppizarror avatar Aug 08 '22 05:08 ppizarror

Indeed on May 10 I done exactly the same https://github.com/ppizarror/pygame-menu/pull/408 ... sorry for the extreme delay. Today I updated the library to v4.3.0, which incorporates this patch.

Greetings! 😄

ppizarror avatar Dec 05 '22 22:12 ppizarror