Skip to content

Commit

Permalink
Set minimum width for HTML buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
susam committed Mar 2, 2022
1 parent 5bd9c5b commit 2764507
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

0.3.0 (2022-03-02)
------------------

### Changed

- Set minimum width for HTML buttons.


0.2.0 (2022-02-18)
------------------

Expand Down
6 changes: 3 additions & 3 deletions invaders.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Andromeda Invaders 0.2.0
Andromeda Invaders 0.3.0
Copyright (c) 2022 Susam Pal
Source: https://github.com/susam/invaders
License: MIT
Expand Down Expand Up @@ -42,7 +42,7 @@

// Metadata for info screen.
const NAME = 'Andromeda Invaders'
const VERSION = '0.2.0'
const VERSION = '0.3.0'
const COPYRIGHT = 'Copyright (c) 2022 Susam Pal'
const SOURCE_URL = 'https://github.com/susam/invaders'

Expand Down Expand Up @@ -290,7 +290,7 @@
}

function resizeButtons (start, len, height, padding) {
const width = (scaledCanvasWidth - (len - 1) * padding) / len
const width = Math.max((scaledCanvasWidth - (len - 1) * padding) / len, 40)
for (let i = start; i < start + len; i++) {
const button = buttonList[i]
button.style.height = height + 'px'
Expand Down

0 comments on commit 2764507

Please sign in to comment.