MCPcopy Create free account
hub / github.com/bluescan/tacentview / GetDialogOrigin

Method GetDialogOrigin

Src/GuiUtil.cpp:231–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229
230
231tVector2 Gutil::GetDialogOrigin(DialogID dialogID)
232{
233 int hindex = int(dialogID) % 4;
234 int vindex = int(dialogID) / 4;
235 if (dialogID == DialogID::Properties)
236 hindex += 2;
237 if (dialogID == DialogID::ThumbnailView)
238 hindex = 0;
239
240 float topOffset = Gutil::GetUIParamExtent(82.0f, 160.0f);
241 float leftOffset = Gutil::GetUIParamScaled(30.0f, 2.5f);
242 float heightDelta = Gutil::GetUIParamScaled(22.0f, 2.5f);
243
244 float widthDelta = 200.0f;
245 float x = leftOffset + widthDelta*float(hindex);
246 float y = topOffset + heightDelta*float(vindex);
247 return tVector2(x, y);
248}
249
250
251tString Gutil::CropStringToWidth(const tString& toCropStr, float cropWidth, bool ellipsis, float* resultWidth)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected