Skip to content

Commit 2801003

Browse files
authored
Merge pull request #49 from tomaz82/fixes
2 parents 3cf1030 + 1801d42 commit 2801003

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- Fix the Location and Size not updating in the Illumination window when right clicking and selecting a bulb.
2020
- Change default zoom to "window"
2121
- Fix zoom combo box to change it values when zoom is changed with mouse wheel.
22+
- Fix TrimImage wrongfully checking blue channel instead of alpha channel.
23+
- Fix ID numbers showing when previewing reels.
2224

2325
2.1.0
2426
- Increased Max ZOrder to 19 from 9 by jonesyUK

b2sbackglassdesigner/b2sbackglassdesigner/Modules/moduleB2S.vb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -351,23 +351,18 @@ Module moduleB2S
351351
Dim bottom As Integer = 0
352352
For y As Integer = 0 To (imageData.Height - 1)
353353
For x As Integer = 0 To (imageData.Width - 1)
354-
Dim isNotTransparent As Boolean = imageARGB((((y * imageData.Width) + x) * 4) + 0) > 0
354+
Dim isNotTransparent As Boolean = imageARGB((((y * imageData.Width) + x) * 4) + 3) > 0
355355
If isNotTransparent Then
356-
If left > x Then
357-
left = x
358-
End If
359-
If right < x Then
360-
right = x
361-
End If
362-
If top > y Then
363-
top = y
364-
End If
365-
If bottom < y Then
366-
bottom = y
367-
End If
356+
If left > x Then left = x
357+
If right < x Then right = x
358+
If top > y Then top = y
359+
If bottom < y Then bottom = y
368360
End If
369361
Next
370362
Next
363+
If left > right Or top > bottom Then
364+
Return Rectangle.Empty ' Fully transparent
365+
End If
371366
Return New Rectangle(left, top, right - left + 1, bottom - top + 1)
372367
End Function
373368

b2sbackglassdesigner/b2sbackglassdesigner/classes/PictureBox/B2SPictureBox.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ Public Class B2SPictureBox
256256
End If
257257
End If
258258
' maybe draw start digit
259-
If .ReelIlluB2SID > 0 Then
259+
If ShowScoreFrames AndAlso .ReelIlluB2SID > 0 Then
260260
TextRenderer.DrawText(pe.Graphics, .ReelIlluB2SID.ToString() & If(.ReelIlluB2SValue > 0, "/" & .ReelIlluB2SValue.ToString(), ""), font, New Rectangle(rect.X + 3, rect.Y + rect.Height - 15, 80, 15), framecolor, Color.White, TextFormatFlags.VerticalCenter Or TextFormatFlags.Left Or TextFormatFlags.NoPrefix)
261261
End If
262262
' maybe draw reel illumination info
263-
If .B2SStartDigit > 0 Then
263+
If ShowScoreFrames AndAlso .B2SStartDigit > 0 Then
264264
Dim toleft As Integer = If(.Equals(Mouse.SelectedScore), 13, 0) 'If(.Equals(Mouse.SelectedBulb), If(isSmallRect, -1, 13), 0)
265265
TextRenderer.DrawText(pe.Graphics, If(.B2SPlayerNo <> eB2SPlayerNo.NotUsed, "P" & CInt(.B2SPlayerNo).ToString() & "/", "") & .B2SStartDigit.ToString(), font, New Rectangle(rect.X + rect.Width - 50, rect.Y + 3, 47 - toleft, 15), framecolor, Color.White, TextFormatFlags.VerticalCenter Or TextFormatFlags.Right Or TextFormatFlags.NoPrefix)
266266
End If

0 commit comments

Comments
 (0)