TurboPack / SynEdit

SynEdit is a syntax highlighting edit control, not based on the Windows common controls.
226 stars 75 forks source link

AV when resizing a form vertically till SynEdit height is 0 #164

Closed ClementDoss closed 2 years ago

ClementDoss commented 2 years ago

Hello, I managed to duplicate the AV in the attached file. Just resize the form vertically till there's only the form caption. I added two screen shots to help.

ResizeAV.zip

( Unit SynDWrite )

Line 720 { TSynWICRenderTarget }

constructor TSynWICRenderTarget.Create(const Width, Height: integer); var BM: TBitmap; RenderTargetProp: TD2D1RenderTargetProperties; begin inherited Create; FWicImage := TWicImage.Create; FWicImage.InterpolationMode := wipmHighQualityCubic; BM := TBitmap.Create(Width, Height); try BM.AlphaFormat := afDefined; FWicImage.Assign(BM); finally BM.Free; end;

RenderTargetProp := D2D1RenderTargetProperties( {$IFDEF GPUSupport} D2D1_RENDER_TARGET_TYPE_DEFAULT, {$ELSE} D2D1_RENDER_TARGET_TYPE_SOFTWARE, // much faster in my desktop with a slow GPU {$ENDIF} D2D1PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_UNKNOWN), // use image format 0, 0, D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE);

CheckOSError(TSynDWrite.D2DFactory.CreateWicBitmapRenderTarget(FWicImage.Handle, RenderTargetProp,FIDW)); ### AV HERE end;

ClementDoss commented 2 years ago

I'm using D11

pyscripter commented 2 years ago

I think this has already been fixed. Could you please try again with the latest version.

ClementDoss commented 2 years ago

Fixed in the latest! Thanks