Skip to content
Permalink
Browse files

oops, fix last commit

  • Loading branch information...
UnknownShadow200 committed Jun 12, 2017
1 parent 11a1175 commit 4e0141ad4e3935d041a4bfcaca867b27f823a41e
Showing with 7 additions and 4 deletions.
  1. +7 −4 ConfigGUI/ColorPicker.cs
@@ -58,8 +58,7 @@ internal sealed class ColorPicker : Form {
const int btnWidth = 130, btnHeight = 40, btnsPerCol = 8;
int index = 0;
void MakeButton( char colCode ) {
int rows = index / btnsPerCol;
if ((index % btnsPerCol) != 0) rows++; // round up
int row = index / btnsPerCol, col = index % btnsPerCol;
index++;

Button btn = new Button();
@@ -83,7 +82,9 @@ internal sealed class ColorPicker : Form {
bCancel.DialogResult = DialogResult.Cancel;
bCancel.Font = new System.Drawing.Font( "Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0 );

int rows = 1 + (index / btnsPerCol);
int rows = index / btnsPerCol;
if ((index % btnsPerCol) != 0) rows++; // round up

int x = 0;
// Centre if even count, align under row if odd count
if ((rows & 1) == 0) {
@@ -105,7 +106,9 @@ internal sealed class ColorPicker : Form {
void MakeWindow(string title) {
AutoScaleDimensions = new System.Drawing.SizeF( 8F, 13F );
AutoScaleMode = AutoScaleMode.Font;
int rows = 1 + (index / btnsPerCol);
int rows = index / btnsPerCol;
if ((index % btnsPerCol) != 0) rows++; // round up

ClientSize = new System.Drawing.Size( 18 + btnWidth * rows, 47 + btnHeight * btnsPerCol );
Font = new System.Drawing.Font( "Lucida Console", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0 );
FormBorderStyle = FormBorderStyle.FixedDialog;

0 comments on commit 4e0141a

Please sign in to comment.
You can’t perform that action at this time.