mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	FIX: [STUDIO-1746] transparent background for images of swtich button
Change-Id: I30012a756242816a69099d211bea444bebc4277d (cherry picked from commit b1efb320cc4290406001994d45b0ef182d6cce30)
This commit is contained in:
		
							parent
							
								
									af7c6502f3
								
							
						
					
					
						commit
						3065771b2c
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -100,10 +100,18 @@ void SwitchButton::Rescale()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		for (int i = 0; i < 2; ++i) {
 | 
							for (int i = 0; i < 2; ++i) {
 | 
				
			||||||
			wxMemoryDC memdc(&dc);
 | 
								wxMemoryDC memdc(&dc);
 | 
				
			||||||
 | 
					#ifdef __WXMSW__
 | 
				
			||||||
			wxBitmap bmp(trackSize.x, trackSize.y);
 | 
								wxBitmap bmp(trackSize.x, trackSize.y);
 | 
				
			||||||
			memdc.SelectObject(bmp);
 | 
								memdc.SelectObject(bmp);
 | 
				
			||||||
			memdc.SetBackground(wxBrush(GetBackgroundColour()));
 | 
								memdc.SetBackground(wxBrush(GetBackgroundColour()));
 | 
				
			||||||
			memdc.Clear();
 | 
								memdc.Clear();
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					            wxImage image(trackSize);
 | 
				
			||||||
 | 
					            image.InitAlpha();
 | 
				
			||||||
 | 
					            memset(image.GetAlpha(), 0, trackSize.GetWidth() * trackSize.GetHeight());
 | 
				
			||||||
 | 
					            wxBitmap bmp(std::move(image));
 | 
				
			||||||
 | 
					            memdc.SelectObject(bmp);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
            memdc.SetFont(dc.GetFont());
 | 
					            memdc.SetFont(dc.GetFont());
 | 
				
			||||||
			auto state = i == 0 ? StateColor::Enabled : (StateColor::Checked | StateColor::Enabled);
 | 
								auto state = i == 0 ? StateColor::Enabled : (StateColor::Checked | StateColor::Enabled);
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue