fix edit cursor highlight on zoomed object (#176)

MSVC assertion fix
stable-5.1
Sven Eberhardt 2010-03-25 20:57:08 +01:00
parent 657735316b
commit f32a4547e3
2 changed files with 9 additions and 2 deletions

View File

@ -423,8 +423,15 @@ void C4EditCursor::Draw(C4TargetFacet &cgo, float Zoom)
uint32_t dwOldBlitMode = cobj->BlitMode;
cobj->ColorMod = 0xffffffff;
cobj->BlitMode = C4GFXBLIT_CLRSFC_MOD2 | C4GFXBLIT_ADDITIVE;
ZoomData zd;
if (~cobj->Category & C4D_Foreground)
{
lpDDraw->GetZoom(&zd);
lpDDraw->SetZoom(cgo.X, cgo.Y, Zoom);
}
cobj->Draw(cgo,-1);
cobj->DrawTopFace(cgo, -1);
if (~cobj->Category & C4D_Foreground) lpDDraw->SetZoom(zd);
cobj->ColorMod = dwOldMod;
cobj->BlitMode = dwOldBlitMode;
}
@ -610,7 +617,7 @@ void C4EditCursor::ApplyToolFill()
bool C4EditCursor::DoContextMenu()
{
bool fObjectSelected = Selection.ObjectCount();
bool fObjectSelected = !!Selection.ObjectCount();
#ifdef _WIN32
POINT point; GetCursorPos(&point);
HMENU hContext = GetSubMenu(hMenu,0);

View File

@ -68,7 +68,7 @@ bool ForLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
#include <cctype>
inline char CharCapital(char cChar) { return std::toupper(cChar); }
bool IsIdentifier(char cChar);
inline bool IsWhiteSpace(char cChar) { return !!std::isspace(cChar); }
inline bool IsWhiteSpace(char cChar) { return !!std::isspace((unsigned char)cChar); }
inline int SLen(const char *sptr) { return sptr?std::strlen(sptr):0; }
inline int SLenUntil(const char *szStr, char cUntil)