-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Andronov Alexander #208
base: master
Are you sure you want to change the base?
Andronov Alexander #208
Conversation
private int segmentsCount = 2; | ||
private List<Vector2> directions = new List<Vector2>(); | ||
|
||
public Rectangle[] Rectangles => rectangles.Select(Rectangle.Truncate).ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не используется.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Всё ещё на месте.
|
||
public class TagCloudLayouter : ITagCloudLayouter | ||
{ | ||
private int i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очень странное название, надо более говорящее.
private readonly RenderOptions options; | ||
private readonly IColorProvider colorProvider; | ||
|
||
private readonly Size imageSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно в локальную переменную.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не исправлено.
private Font GetAdjustedFont(Graphics graphic, string text, Font originalFont, Size boxSize, int maxFontSize, int minFontSize, bool smallestOnFail) | ||
{ | ||
for (int adjustedSize = maxFontSize; adjustedSize >= minFontSize; adjustedSize--) | ||
{ | ||
Font testFont = new Font(originalFont.Name, adjustedSize, originalFont.Style); | ||
|
||
SizeF newSize = graphic.MeasureString(text, testFont); | ||
|
||
if (boxSize.Width > Convert.ToInt32(newSize.Width) && | ||
boxSize.Height > Convert.ToInt32(newSize.Height)) | ||
{ | ||
return testFont; | ||
} | ||
} | ||
|
||
if (smallestOnFail) | ||
{ | ||
return new Font(originalFont.Name, minFontSize, originalFont.Style); | ||
} | ||
else | ||
{ | ||
return originalFont; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не используется.
|
||
public Bitmap Render(WordLayout[] wordLayouts) | ||
{ | ||
var rectangles = wordLayouts.Select(x => x.Box).ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не используется.
|
||
public Bitmap CreateCloud(Dictionary<string, int> frequencyDict) | ||
{ | ||
var kvps = frequencyDict.OrderByDescending(x => x.Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не самое лучшее название для переменной.
|
||
foreach (var kvp in kvps) | ||
{ | ||
var mul = TagCloudHelpers.GetMultiplier(kvp.Value, minFreq, maxFreq); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Странное стремление к сокращению всего и вся. Что за множитель из контекста непонятно совершенно, надо отразить в названии.
} | ||
|
||
|
||
private static WordExtractionOptions CreateWordExtractoroptions(Options clOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Опечатка.
{ | ||
var radians = angle * Math.PI / 180; | ||
var tangent = Math.Tan(radians); | ||
var x = 1f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для чего эта переменная?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Окей, в комментах увидел, зачем. Но всё ещё такой же вопрос, зачем нам множитель, равный 1?
No description provided.