|
1 | 1 | using LogExpert.Core.Classes.Filter; |
2 | | - |
3 | 2 | using System.Diagnostics; |
4 | 3 | using System.Drawing; |
5 | 4 | using System.Runtime.Versioning; |
@@ -402,59 +401,6 @@ public static void AssertTrue(bool condition, string msg) |
402 | 401 | } |
403 | 402 | } |
404 | 403 |
|
405 | | - [SupportedOSPlatform("windows")] |
406 | | - public string GetWordFromPos(int xPos, string text, Graphics g, Font font) |
407 | | - { |
408 | | - string[] words = text.Split([' ', '.', ':', ';']); |
409 | | - |
410 | | - int index = 0; |
411 | | - |
412 | | - List<CharacterRange> crList = []; |
413 | | - |
414 | | - for (int i = 0; i < words.Length; ++i) |
415 | | - { |
416 | | - crList.Add(new CharacterRange(index, words[i].Length)); |
417 | | - index += words[i].Length; |
418 | | - } |
419 | | - |
420 | | - CharacterRange[] crArray = [.. crList]; |
421 | | - |
422 | | - StringFormat stringFormat = new(StringFormat.GenericTypographic) |
423 | | - { |
424 | | - Trimming = StringTrimming.None, |
425 | | - FormatFlags = StringFormatFlags.NoClip |
426 | | - }; |
427 | | - |
428 | | - stringFormat.SetMeasurableCharacterRanges(crArray); |
429 | | - |
430 | | - RectangleF rect = new(0, 0, 3000, 20); |
431 | | - Region[] stringRegions = g.MeasureCharacterRanges(text, font, rect, stringFormat); |
432 | | - |
433 | | - bool found = false; |
434 | | - |
435 | | - int y = 0; |
436 | | - |
437 | | - foreach (Region regio in stringRegions) |
438 | | - { |
439 | | - if (regio.IsVisible(xPos, 3, g)) |
440 | | - { |
441 | | - found = true; |
442 | | - break; |
443 | | - } |
444 | | - |
445 | | - y++; |
446 | | - } |
447 | | - |
448 | | - if (found) |
449 | | - { |
450 | | - return words[y]; |
451 | | - } |
452 | | - else |
453 | | - { |
454 | | - return null; |
455 | | - } |
456 | | - } |
457 | | - |
458 | 404 | #endregion |
459 | 405 |
|
460 | 406 | #region Private Methods |
|
0 commit comments