Skip to content

Commit

Permalink
Fix color wheel rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerhelland committed Sep 27, 2016
1 parent bd78c6b commit 879d0b2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Classes/cSelfSubHookCallback.cls
Expand Up @@ -211,7 +211,7 @@ Public Function ssc_Subclass(ByVal lng_hWnd As Long, _
'Const IDX_BTABLE As Long = 11 'Thunk data index of the Before table
'Const IDX_ATABLE As Long = 12 'Thunk data index of the After table
'Const IDX_PARM_USER As Long = 13 'Thunk data index of the User-defined callback parameter data index
Const IDX_DW As Long = 14 'Thunk data index of the DestroyWinodw function address
Const IDX_DW As Long = 14 'Thunk data index of the DestroyWindow function address
Const IDX_ST As Long = 15 'Thunk data index of the SetTimer function address
Const IDX_KT As Long = 16 'Thunk data index of the KillTimer function address
Const IDX_EBX_TMR As Long = 20 'Thunk code patch index of the thunk data for the delay timer
Expand Down Expand Up @@ -720,8 +720,7 @@ Private Function zAddressOf(ByVal oCallback As Object, ByVal nOrdinal As Long) A
End If

i = i + 4 'Bump to the next entry
'J = I + 1024 'Set a reasonable limit, scan 256 vTable entries
j = i + 1024 * 2 'Set a reasonable limit, scan 512 vTable entries
j = i + 1024 * 2 'Set a reasonable limit, scan 512 vTable entries
Do While i < j
RtlMoveMemory VarPtr(nAddr), i, 4 'Get the address stored in this vTable entry

Expand Down
4 changes: 2 additions & 2 deletions Controls/pdColorWheel.ctl
Expand Up @@ -470,7 +470,7 @@ Private Sub CreateColorWheel()
' the max available diameter, and the current screen DPI.
m_HueRadiusOuter = (CSng(wheelDiameter) / 2) - FixDPIFloat(WHEEL_PADDING)
m_HueRadiusInner = m_HueRadiusOuter - FixDPIFloat(WHEEL_WIDTH)
If m_HueRadiusInner < 5 Then m_HueRadiusInner = 5
If (m_HueRadiusInner < 5) Then m_HueRadiusInner = 5

'We're now going to cheat a bit and use a 2D drawing hack to solve for the alpha bytes of our wheel. The wheel image is
' already a black square, and atop that we're going to draw a white circle at the outer radius size, and a black circle
Expand Down Expand Up @@ -575,7 +575,7 @@ Private Sub CreateSVSquare()
End If

'To prevent IDE crashes, bail now during compilation
If Not g_IsProgramRunning Then Exit Sub
If (Not g_IsProgramRunning) Then Exit Sub

'We now need to fill the square with all possible saturation and value variants, in a pattern where...
' - The y-axis position determines value (1 -> 0)
Expand Down
2 changes: 1 addition & 1 deletion Modules/GDIPlus.bas
Expand Up @@ -3043,7 +3043,7 @@ End Function
' 3) control stretch mode directly inside the call
Public Sub GDIPlus_StretchBlt(ByRef dstDIB As pdDIB, ByVal x1 As Single, ByVal y1 As Single, ByVal dstWidth As Single, ByVal dstHeight As Single, ByRef srcDIB As pdDIB, ByVal x2 As Single, ByVal y2 As Single, ByVal srcWidth As Single, ByVal srcHeight As Single, Optional ByVal newAlpha As Single = 1#, Optional ByVal interpolationType As GP_InterpolationMode = GP_IM_HighQualityBicubic, Optional ByVal useThisDestinationDCInstead As Long = 0, Optional ByVal disableEdgeFix As Boolean = False, Optional ByVal isZoomedIn As Boolean = False)

If (dstDIB Is Nothing) Then Exit Sub
If ((dstDIB Is Nothing) And (useThisDestinationDCInstead = 0)) Then Exit Sub

'Because this function is such a crucial part of PD's render chain, I occasionally like to profile it against
' viewport engine changes. Uncomment the two lines below, and the reporting line at the end of the sub to
Expand Down
2 changes: 1 addition & 1 deletion PhotoDemon.vbp
Expand Up @@ -362,7 +362,7 @@ Description="PhotoDemon Photo Editor"
CompatibleMode="0"
MajorVer=6
MinorVer=7
RevisionVer=1947
RevisionVer=1948
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Copyright 2000-2016 Tanner Helland - photodemon.org"
Expand Down

0 comments on commit 879d0b2

Please sign in to comment.