@@ -455,19 +455,19 @@ bool CUIXmlInit::InitDragDropListEx(CUIXml& xml_doc, const char* path, int index
455
455
int cell_size = xml_doc.ReadAttribInt (path, index, " cell_size" , 50 ); // UP
456
456
457
457
// Определяем максимально допустимый размер ячеек, при котором у нас вместится нужное количество.
458
- max_cell_size.x = iFloor (_max (1 .f , (real_wh.x - 1 .f )) / _max ((float )w_cells.x , 1 .0f )); // UP
459
- max_cell_size.y = iFloor (_max (1 .f , (real_wh.y - 1 .f )) / _max ((float )w_cells.y , 1 .0f )); // UP
458
+ max_cell_size.x = ( int ) trunc (_max (1 .f , (real_wh.x - 1 .f )) / _max ((float )w_cells.x , 1 .0f )); // UP
459
+ max_cell_size.y = ( int ) trunc (_max (1 .f , (real_wh.y - 1 .f )) / _max ((float )w_cells.y , 1 .0f )); // UP
460
460
float safe_cell_scale = _max (
461
461
float (cell_size) / _max (1 .0f , float (max_cell_size.x )),
462
462
float (cell_size) / _max (1 .0f , float (max_cell_size.y ))
463
463
);
464
464
float real_cell_size = float (cell_size) / safe_cell_scale; // UP
465
465
// Вычисляем размеры ячеек в координатах 1024-768
466
- w_cell_sz.x = iFloor (real_cell_size * device_scale.x ); // CP // cell size in grid
467
- w_cell_sz.y = iFloor (real_cell_size * device_scale.y ); // CP
466
+ w_cell_sz.x = ( int ) round (real_cell_size * device_scale.x ); // CP // cell size in grid
467
+ w_cell_sz.y = ( int ) round (real_cell_size * device_scale.y ); // CP
468
468
// Вычисляем количество ячеек в координатах 1024-768
469
- w_cells.x = iFloor (_max (1 .f , (width - 1 .f )) / _max ((float )w_cell_sz.x , 1 .0f )); // cell count in grid
470
- w_cells.y = iFloor (_max (1 .f , (height - 1 .f )) / _max ((float )w_cell_sz.y , 1 .0f ));
469
+ w_cells.x = ( int ) round (_max (1 .f , (width - 1 .f )) / _max ((float )w_cell_sz.x , 1 .0f )); // cell count in grid
470
+ w_cells.y = ( int ) round (_max (1 .f , (height - 1 .f )) / _max ((float )w_cell_sz.y , 1 .0f ));
471
471
472
472
w_cell_sp.x = xml_doc.ReadAttribInt (path, index, " cell_sp_x" , 0 );
473
473
w_cell_sp.y = xml_doc.ReadAttribInt (path, index, " cell_sp_y" , 0 );
0 commit comments