mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	patch image.cpp and window.mm
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
This commit is contained in:
		
							parent
							
								
									c5df337f01
								
							
						
					
					
						commit
						1a2d127276
					
				
					 2 changed files with 92 additions and 16 deletions
				
			
		|  | @ -1,3 +1,33 @@ | ||||||
|  | From 5e82980ed1762338794d06b3f9f22fa10e050622 Mon Sep 17 00:00:00 2001 | ||||||
|  | From: SoftFever <softfeverever@gmail.com> | ||||||
|  | Date: Sat, 23 Dec 2023 20:08:41 +0800 | ||||||
|  | Subject: [PATCH] wx 3.1.5 patch for Orca | ||||||
|  | 
 | ||||||
|  | ---
 | ||||||
|  |  build/cmake/init.cmake                 |  4 ++ | ||||||
|  |  build/cmake/lib/webview/CMakeLists.txt |  4 +- | ||||||
|  |  include/wx/fontutil.h                  | 15 +++++++- | ||||||
|  |  include/wx/gdicmn.h                    |  3 ++ | ||||||
|  |  include/wx/generic/grid.h              |  4 +- | ||||||
|  |  include/wx/msw/font.h                  |  2 +- | ||||||
|  |  include/wx/msw/tooltip.h               |  4 +- | ||||||
|  |  include/wx/osx/app.h                   |  2 +- | ||||||
|  |  src/common/combocmn.cpp                | 13 +++++-- | ||||||
|  |  src/common/datavcmn.cpp                |  6 ++- | ||||||
|  |  src/common/dcbufcmn.cpp                |  8 +++- | ||||||
|  |  src/common/gdicmn.cpp                  | 14 +++++++ | ||||||
|  |  src/common/image.cpp                   |  6 +-- | ||||||
|  |  src/common/intl.cpp                    |  7 ++++ | ||||||
|  |  src/generic/grid.cpp                   | 53 +++++++++++++++++++++----- | ||||||
|  |  src/msw/bmpcbox.cpp                    |  9 ++++- | ||||||
|  |  src/msw/font.cpp                       | 14 +++---- | ||||||
|  |  src/msw/menuitem.cpp                   |  2 + | ||||||
|  |  src/msw/window.cpp                     | 52 ++++++++++++++++--------- | ||||||
|  |  src/osx/cocoa/dataview.mm              | 26 +++++++++++-- | ||||||
|  |  src/osx/cocoa/settings.mm              |  6 +-- | ||||||
|  |  src/osx/cocoa/window.mm                |  4 ++ | ||||||
|  |  22 files changed, 199 insertions(+), 59 deletions(-) | ||||||
|  | 
 | ||||||
| diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
 | diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
 | ||||||
| index 0bc4f934b9..479431a69c 100644
 | index 0bc4f934b9..479431a69c 100644
 | ||||||
| --- a/build/cmake/init.cmake
 | --- a/build/cmake/init.cmake
 | ||||||
|  | @ -15,10 +45,10 @@ index 0bc4f934b9..479431a69c 100644 | ||||||
|                  if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND) |                  if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND) | ||||||
|                      list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES}) |                      list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES}) | ||||||
| diff --git a/build/cmake/lib/webview/CMakeLists.txt b/build/cmake/lib/webview/CMakeLists.txt
 | diff --git a/build/cmake/lib/webview/CMakeLists.txt b/build/cmake/lib/webview/CMakeLists.txt
 | ||||||
| index cc3298ff33..8adbeaea4f 100644
 | index cc3298ff33..aa103ae474 100644
 | ||||||
| --- a/build/cmake/lib/webview/CMakeLists.txt
 | --- a/build/cmake/lib/webview/CMakeLists.txt
 | ||||||
| +++ b/build/cmake/lib/webview/CMakeLists.txt
 | +++ b/build/cmake/lib/webview/CMakeLists.txt
 | ||||||
| @@ -56,7 +56,7 @@ if(APPLE)
 | @@ -56,9 +56,9 @@ if(APPLE)
 | ||||||
|  elseif(WXMSW) |  elseif(WXMSW) | ||||||
|      if(wxUSE_WEBVIEW_EDGE) |      if(wxUSE_WEBVIEW_EDGE) | ||||||
|          # Update the following variables if updating WebView2 SDK |          # Update the following variables if updating WebView2 SDK | ||||||
|  | @ -28,8 +58,10 @@ index cc3298ff33..8adbeaea4f 100644 | ||||||
| -        set(WEBVIEW2_SHA256 "6a34bb553e18cfac7297b4031f3eac2558e439f8d16a45945c22945ac404105d")
 | -        set(WEBVIEW2_SHA256 "6a34bb553e18cfac7297b4031f3eac2558e439f8d16a45945c22945ac404105d")
 | ||||||
| +        set(WEBVIEW2_SHA256 "51d2ef56196e2a9d768a6843385bcb9c6baf9ed34b2603ddb074fb4995543a99")
 | +        set(WEBVIEW2_SHA256 "51d2ef56196e2a9d768a6843385bcb9c6baf9ed34b2603ddb074fb4995543a99")
 | ||||||
|   |   | ||||||
|  |          set(WEBVIEW2_DEFAULT_PACKAGE_DIR "${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2.${WEBVIEW2_VERSION}") | ||||||
|  |   | ||||||
| diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h
 | diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h
 | ||||||
| index 09ad8c8ef3..3c0c2d8f7e 100644
 | index 09ad8c8ef3..c228e167d7 100644
 | ||||||
| --- a/include/wx/fontutil.h
 | --- a/include/wx/fontutil.h
 | ||||||
| +++ b/include/wx/fontutil.h
 | +++ b/include/wx/fontutil.h
 | ||||||
| @@ -294,7 +294,11 @@ public:
 | @@ -294,7 +294,11 @@ public:
 | ||||||
|  | @ -149,7 +181,7 @@ index 317a0ca96f..58014ec1d4 100644 | ||||||
|      void                OSXStoreOpenURL(const wxString &url ) { m_getURL = url ; } |      void                OSXStoreOpenURL(const wxString &url ) { m_getURL = url ; } | ||||||
|  #endif |  #endif | ||||||
| diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp
 | diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp
 | ||||||
| index b61aac35bf..d12b745e8c 100644
 | index b61aac35bf..7cfc97d2f8 100644
 | ||||||
| --- a/src/common/combocmn.cpp
 | --- a/src/common/combocmn.cpp
 | ||||||
| +++ b/src/common/combocmn.cpp
 | +++ b/src/common/combocmn.cpp
 | ||||||
| @@ -2141,7 +2141,7 @@ void wxComboCtrlBase::CreatePopup()
 | @@ -2141,7 +2141,7 @@ void wxComboCtrlBase::CreatePopup()
 | ||||||
|  | @ -226,7 +258,7 @@ index 74958fce10..59844f4526 100644 | ||||||
|          return buffer; |          return buffer; | ||||||
|      } |      } | ||||||
| diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp
 | diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp
 | ||||||
| index 20442bbc73..9a24951ec7 100644
 | index 20442bbc73..bc2c35bee6 100644
 | ||||||
| --- a/src/common/gdicmn.cpp
 | --- a/src/common/gdicmn.cpp
 | ||||||
| +++ b/src/common/gdicmn.cpp
 | +++ b/src/common/gdicmn.cpp
 | ||||||
| @@ -863,11 +863,25 @@ void wxDisplaySize(int *width, int *height)
 | @@ -863,11 +863,25 @@ void wxDisplaySize(int *width, int *height)
 | ||||||
|  | @ -255,8 +287,27 @@ index 20442bbc73..9a24951ec7 100644 | ||||||
|  void wxClientDisplayRect(int *x, int *y, int *width, int *height) |  void wxClientDisplayRect(int *x, int *y, int *width, int *height) | ||||||
|  { |  { | ||||||
|      const wxRect rect = wxGetClientDisplayRect(); |      const wxRect rect = wxGetClientDisplayRect(); | ||||||
|  | diff --git a/src/common/image.cpp b/src/common/image.cpp
 | ||||||
|  | index 78fe5b82a3..46db8722ce 100644
 | ||||||
|  | --- a/src/common/image.cpp
 | ||||||
|  | +++ b/src/common/image.cpp
 | ||||||
|  | @@ -383,11 +383,11 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const
 | ||||||
|  |                      unsigned char red = pixel[0] ; | ||||||
|  |                      unsigned char green = pixel[1] ; | ||||||
|  |                      unsigned char blue = pixel[2] ; | ||||||
|  | -                    unsigned char alpha = 255  ;
 | ||||||
|  | -                    if ( source_alpha )
 | ||||||
|  | -                        alpha = *(source_alpha + y_offset + x * xFactor + x1) ;
 | ||||||
|  |                      if ( !hasMask || red != maskRed || green != maskGreen || blue != maskBlue ) | ||||||
|  |                      { | ||||||
|  | +                        unsigned char alpha = 255  ;
 | ||||||
|  | +                        if ( source_alpha )
 | ||||||
|  | +                            alpha = *(source_alpha + y_offset + x * xFactor + x1) ;
 | ||||||
|  |                          if ( alpha > 0 ) | ||||||
|  |                          { | ||||||
|  |                              avgRed += red ; | ||||||
| diff --git a/src/common/intl.cpp b/src/common/intl.cpp
 | diff --git a/src/common/intl.cpp b/src/common/intl.cpp
 | ||||||
| index 0b0d8798f4..7072fab18a 100644
 | index 0b0d8798f4..294f542b1f 100644
 | ||||||
| --- a/src/common/intl.cpp
 | --- a/src/common/intl.cpp
 | ||||||
| +++ b/src/common/intl.cpp
 | +++ b/src/common/intl.cpp
 | ||||||
| @@ -1628,6 +1628,12 @@ GetInfoFromLCID(LCID lcid,
 | @@ -1628,6 +1628,12 @@ GetInfoFromLCID(LCID lcid,
 | ||||||
|  | @ -665,3 +716,28 @@ index de5f52860c..a9581174a4 100644 | ||||||
|              return value; |              return value; | ||||||
|   |   | ||||||
|          // TODO case wxSYS_FRAMESIZE_X: |          // TODO case wxSYS_FRAMESIZE_X: | ||||||
|  | diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm
 | ||||||
|  | index b322e582c5..79de567333 100644
 | ||||||
|  | --- a/src/osx/cocoa/window.mm
 | ||||||
|  | +++ b/src/osx/cocoa/window.mm
 | ||||||
|  | @@ -190,6 +190,9 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const
 | ||||||
|  |  - (BOOL)isEnabled; | ||||||
|  |  - (void)setEnabled:(BOOL)flag; | ||||||
|  |   | ||||||
|  | +- (BOOL)clipsToBounds;
 | ||||||
|  | +- (void)setClipsToBounds:(BOOL)clipsToBounds;
 | ||||||
|  | +
 | ||||||
|  |  - (void)setImage:(NSImage *)image; | ||||||
|  |  - (void)setControlSize:(NSControlSize)size; | ||||||
|  |   | ||||||
|  | @@ -2505,6 +2508,7 @@ wxWidgetImpl( peer, flags )
 | ||||||
|  |      if ( m_osxView ) | ||||||
|  |          CFRetain(m_osxView); | ||||||
|  |      [m_osxView release]; | ||||||
|  | +    m_osxView.clipsToBounds = YES;
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |   | ||||||
|  | -- 
 | ||||||
|  | 2.41.0.windows.2 | ||||||
|  | 
 | ||||||
							
								
								
									
										6
									
								
								deps/wxWidgets/wxWidgets.cmake
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								deps/wxWidgets/wxWidgets.cmake
									
										
									
									
										vendored
									
									
								
							|  | @ -17,13 +17,13 @@ else () | ||||||
| endif () | endif () | ||||||
| 
 | 
 | ||||||
| if (MSVC) | if (MSVC) | ||||||
|     set(_patch_cmd if not exist WXWIDGETS_PATCHED ( "${GIT_EXECUTABLE}" apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-wxWidget-fix.patch && type nul > WXWIDGETS_PATCHED ) ) |     set(_patch_cmd if not exist WXWIDGETS_PATCHED ( "${GIT_EXECUTABLE}" apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-wx-3.1.5-patch-for-Orca.patch && type nul > WXWIDGETS_PATCHED ) ) | ||||||
| else () | else () | ||||||
|     set(_patch_cmd test -f WXWIDGETS_PATCHED || ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-wxWidget-fix.patch && touch WXWIDGETS_PATCHED) |     set(_patch_cmd test -f WXWIDGETS_PATCHED || ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-wx-3.1.5-patch-for-Orca.patch && touch WXWIDGETS_PATCHED) | ||||||
| endif () | endif () | ||||||
| 
 | 
 | ||||||
| if (CMAKE_SYSTEM_NAME STREQUAL "Linux") | if (CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||||||
|     set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-wxWidget-fix.patch) |     set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-wx-3.1.5-patch-for-Orca.patch) | ||||||
| endif () | endif () | ||||||
| 
 | 
 | ||||||
| orcaslicer_add_cmake_project( | orcaslicer_add_cmake_project( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 SoftFever
						SoftFever